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#!/usr/bin/env python\n# Copyright (c) Facebook, Inc. and its affiliates.\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport spe... | python | edit | 1 | 1 | apache-2.0 | 1082db1f71ed3e84fd4068d3834ce72e744cdcca | facebook/wangle,facebook/wangle,facebook/wangle | build/fbcode_builder/specs/fbthrift.py | rejected_duplicate | Near-duplicate of sample 4388 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*\n\"\"\"\n`grappa` provides two different testing styles: `should` and `expect`.\n\nshould\n------\n\nExample using ``should`` style::\n\n from grappa import should\n\n should('foo').be.equal.to('foo')\n 'foo'... | python | edit | 1 | 0 | mit | 227244ae21c98b52a460beb942a8200ab66c0633 | grappa-py/grappa | grappa/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"yolk.\n\nAuthor: Rob Cakebread <cakebread at gmail>\n\nLicense : BSD\n\n\"\"\"\n\n__version__ = '0.6.2'\n\n```\n\nApply this change: Increment minor version to 0.7"
},
{
"role": "assistant",
"content": "\"\"\"yolk.\n\nAut... | python | edit | 1 | 0 | bsd-3-clause | 30bfdd3a6e31db6849f650406bc8014f836dda62 | myint/yolk,myint/yolk | yolk/__init__.py | rejected_duplicate | Near-duplicate of sample 3058 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nFile: abstract_constraint.py\n\nPurpose: Define a constraint, in an abstract sense, related to a number of actors.\n\n\"\"\"\nfrom abc import ABCMeta, abstractmethod\n\n\nclass AbstractConstraint(object):\n \"\"\"\n Class th... | python | edit | 1 | 2 | mit | e5acbfc176de3b531528c8b15f57e5d3feab3ad1 | dpazel/music_rep | melody/constraints/abstract_constraint.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\ndef default_logging(grab_log='/tmp/grab.log'):\n \"\"\"\n Customize logging output to display all log messages\n except grab network logs.\n\n Redirect grab network logs into file.\n \"\"\"\n\n logging.ba... | python | edit | 1 | 2 | mit | c07f9d2b455ec312d22a5aa07f9d724ee4cd1e42 | SpaceAppsXploration/grab,maurobaraldi/grab,giserh/grab,lorien/grab,SpaceAppsXploration/grab,subeax/grab,huiyi1990/grab,raybuhr/grab,DDShadoww/grab,codevlabs/grab,pombredanne/grab-1,liorvh/grab,lorien/grab,DDShadoww/grab,huiyi1990/grab,codevlabs/grab,alihalabyah/grab,liorvh/grab,maurobaraldi/grab,subeax/grab,istinspring... | grab/tools/logs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__version__ = (0, 3, 'dev')\n\n\nfrom memory import *\nfrom models import *\nfrom columns import *\nfrom options import *\n\n```\n\nApply this change: Prepare to fix a new version."
},
{
"role": "assistant",
"content": "__versio... | python | edit | 5 | 0 | bsd-2-clause | 80d052df13653943bc2a2369cfbea4cf0e77ce12 | PolicyStat/django-tables,miracle2k/django-tables,isolationism/mongoengine-tables | django_tables/__init__.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Django haystack `SearchIndex` module.\"\"\"\nfrom pages.models import Page, Content\n\nfrom haystack.indexes import SearchIndex, CharField, DateTimeField\nfrom haystack import site\n\nimport datetime\n\nclass PageIndex(SearchIndex):\n... | python | edit | 4 | 1 | bsd-3-clause | e046bbd4027275a94888bd70138000cdb2da67f3 | batiste/django-page-cms,remik/django-page-cms,remik/django-page-cms,oliciv/django-page-cms,remik/django-page-cms,akaihola/django-page-cms,pombredanne/django-page-cms-1,akaihola/django-page-cms,remik/django-page-cms,oliciv/django-page-cms,oliciv/django-page-cms,pombredanne/django-page-cms-1,akaihola/django-page-cms,bati... | pages/search_indexes.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Write python code for the following: Resolve Combination Sum III with recursion"
},
{
"role": "assistant",
"content": "class Solution(object):\n def combinationSum3(self, k, n):\n \"\"\"\n :type k: int\n :type n: int\n :rtype: List[Lis... | python | new_file | 17 | 18 | apache-2.0 | 74eb0a324acd75f43aa4efa731c7fc289c5987dd | shuquan/leetcode | medium/combination-sum-iii/python/combination-sum-iii.py | rejected_lint | Too many lint violations: 17 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\n* when dispatching events, returning True stops it.\n'''\n\n\nfrom weakref import ref\nfrom kivy.event import EventDispatcher\nfrom kivy.properties import StringProperty, OptionProperty, ObjectProperty\nimport logging\n\n\nclass MoaExc... | python | edit | 3 | 6 | mit | 819f36493e1e0112c3bbe4f92f87f1771cc4af3f | matham/moa | moa/base.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\"\"\" Extracts the version of the khmer project. \"\"\"\n\nimport sys\nimport pkg_resources\n\ntry:\n print pkg_resources.get_distribution( # pylint: disable=E1103\n 'khmer').version\nexcept pkg_resources.... | python | edit | 2 | 0 | bsd-3-clause | 0db4d0f3df3b9541aaf6301c11f83376debb41ff | Winterflower/khmer,kdmurray91/khmer,souravsingh/khmer,souravsingh/khmer,Winterflower/khmer,jas14/khmer,ged-lab/khmer,ged-lab/khmer,Winterflower/khmer,F1000Research/khmer,F1000Research/khmer,jas14/khmer,kdmurray91/khmer,souravsingh/khmer,ged-lab/khmer,kdmurray91/khmer,F1000Research/khmer,jas14/khmer | lib/get_version.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add Jaro-Winkler distance based on py_stringmatching"
},
{
"role": "assistant",
"content": "import py_stringmatching\nfrom itertools import combinations\nfrom time import time\n\njw = py_stringmatching.JaroWinkler()\nstart = time... | python | new_file | 3 | 0 | mit | 680f9e27ddef3be13b025cffd2041e7fece35f64 | studiawan/pygraphc | pygraphc/similarity/pysmJaroWinkler.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport numpy\nimport ast\n\nfrom django.db import models\n\n\nclass DataPoint(models.Model):\n name = models.CharField(max_length=600)\n exact_name = models.CharField(max_length=1000, null=True, blank=True)\n decay_feature = models... | python | edit | 1 | 2 | mit | 246d2f47791f26ffe55bc9d09c59875b6045a847 | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | data/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n configuration.py\n\n\"\"\"\nfrom trytond.model import fields, ModelSingleton, ModelSQL, ModelView\n\n__all__ = ['EndiciaConfiguration']\n\n\nclass EndiciaConfiguration(ModelSingleton, ModelSQL, ModelView... | python | edit | 1 | 3 | bsd-3-clause | a5cd2110283ba699f36548c42b83aa86e6b50aab | priyankarani/trytond-shipping-endicia,fulfilio/trytond-shipping-endicia,prakashpp/trytond-shipping-endicia | configuration.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.http import HttpResponse\nfrom django.shortcuts import render\n\n\ndef func(request):\n return HttpResponse(\"This is my first django project!\")\n\n\ndef add(request):\n a = request.GET['a']\n b = request.GET['b']\n ... | python | edit | 1 | 1 | apache-2.0 | 9d26f1d7a23e69bf7beae78674eb3ba6511e3f28 | wmh-demos/django-first-demo,wmh-demos/django-first-demo | my_app/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport txredisapi as redis\nfrom twisted.internet import defer, reactor\nimport config\n\nconnection = None\n\n@defer.inlineCallbacks\ndef run_redis_client(on_started):\n pony = yield redis.makeConnection(config.redis['host'],\n ... | python | edit | 4 | 1 | mit | 7a3c4eed8888c8c2befc94020bebbfc18e1d6156 | prophile/compd,prophile/compd | src/redis_client.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import namedtuple\n\nRemote = namedtuple('Remote', ('name', 'url'))\nCommitInfo = namedtuple(\"CommitInfo\",\n ('commit', 'origin', 'remote_repo', 'ref'))\n\n\nclass PRInfo(object):\n def __init__(... | python | edit | 1 | 2 | mit | 13d0dfd957c1159c7fe6377637b10996ef91afcd | richtier/imhotep,justinabrahms/imhotep,justinabrahms/imhotep | imhotep/shas.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: UTF-8 -*-\n# Copyright 2016 Luc Saffre\n# License: BSD (see file COPYING for details)\n\"\"\"Fixtures specific for the Team variant of Lino Noi.\n\n.. autosummary::\n :toctree:\n\n models\n\n\n\"\"\"\n\nfrom lino_xl.lib.ti... | python | edit | 3 | 2 | bsd-2-clause | 563645019adaf20ee66af0b4cc13e8b08bcc9d32 | khchine5/noi,lsaffre/noi,lsaffre/noi,lino-framework/noi,lino-framework/noi,khchine5/noi,lsaffre/noi | lino_noi/lib/tickets/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom akatsuki.exporter import export_html\nfrom akatsuki.parser import load_bibtex_file\nfrom akatsuki.utils import sort_by_date\n\n\ndef main(bibt... | python | edit | 1 | 1 | mit | d0aba6489a96003c9a746bd38818cffa717d1469 | 403JFW/akatsuki | akatsuki/bib2html.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###############################################################################\n# Copyright Kitware Inc.\n#\n# Licensed under the Apache License, Version 2.0 ( the \"License\" );\n# you ... | python | edit | 1 | 0 | apache-2.0 | 1e931e9aac18f393de786894d9e26ecccc251135 | ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive | server/models/_generate_superpixels.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.utils.translation import ugettext_lazy as _\nfrom django.http import HttpResponseBadRequest\n\nfrom temba_client.base import TembaAPIError\n\n\nclass HandleTembaAPIError(object):\n \"\"\" Catch all Temba exception errors \"\"... | python | edit | 1 | 5 | bsd-3-clause | d38617dd6bf5c7b0f17245dd5a5e95a335ac6626 | xkmato/tracpro,rapidpro/tracpro,rapidpro/tracpro,xkmato/tracpro,xkmato/tracpro,rapidpro/tracpro,xkmato/tracpro | tracpro/orgs_ext/middleware.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport shlex\n\n\nclass Clues:\n DEFAULT_FILENAME = os.getcwd() + os.sep + 'subjectivity_clues' + os.sep + 'subjclueslen1-HLTEMNLP05.tff'\n\n def __init__(self, filename=DEFAULT_FILENAME):\n lines = self.read_all(fil... | python | edit | 1 | 3 | apache-2.0 | 6e583085ac056b7df2b29a94cd6743493c151684 | chuajiesheng/twitter-sentiment-analysis | subjectivity_clues/clues.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nAPI_GROUPS = {\n 'authentication': ['/api-auth/', '/api/auth-valimo/',],\n 'user': ['/api/users/', '/api/user-invitations/', '/api/user-counters/',],\n 'organization': [\n '/api/customers/',\n '/api/customer-permissio... | python | edit | 1 | 0 | mit | 5fb365333711f7e999f71d53061ae14c386e575c | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind | src/waldur_core/core/api_groups_mapping.py | accepted | null | true |
[
{
"role": "user",
"content": "Write python code for the following: Add model to store log data"
},
{
"role": "assistant",
"content": "from django.db import models\n\n\nclass DataPoint(models.Model):\n name = models.CharField(max_length=200)\n exact_name = models.CharField(max_length=600, n... | python | new_file | 1 | 0 | mit | 8581fae9a70571ed19a97078b7de87eeae8b7033 | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | data/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nfrom chatterbot import ChatBot\n\n\nbot = ChatBot(\n \"Unit Converter\",\n logic_adapters=[\n \"chatterbot.logic.UnitConversion\",\n ],\n input_adapter=\"chatterbot.input.VariableInputTypeAdapter\... | python | edit | 1 | 0 | bsd-3-clause | b47ecb3464585d762c17694190286388c25dbaf8 | gunthercox/ChatterBot,vkosuri/ChatterBot | examples/convert_units.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport pytest\n\nfrom wagtail_personalisation import adapters\nfrom tests.factories.segment import SegmentFactory\n\n\n@pytest.mark.django_db\ndef test_get_segments(rf, monkeypatch):\n request = rf.get('/')\n\n adapter = adapters.Sess... | python | edit | 1 | 1 | mit | 5eefa21699f2dc7b75a919b5899a25ec7ef5c5b7 | LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation | tests/unit/test_adapter_session.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n_VERSION = 'CVS'\n_TEMP_DIR = '.SloppyCell'\n\nimport logging\nlogging.basicConfig()\nlogger = logging.getLogger('__init__')\n\n# Check for debugging option. I tried using optparse for this, but ran into\n# issues with ipython and mpirun, b... | python | edit | 3 | 0 | bsd-3-clause | 78665865038cf676290fb1058bd2194e4c506869 | GutenkunstLab/SloppyCell,GutenkunstLab/SloppyCell | __init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n Unit tests for the SESANS .ses reader\n\"\"\"\n\nimport unittest\nfrom sas.sascalc.dataloader.loader import Loader\n\nimport os.path\n\nclass sesans_reader(unittest.TestCase):\n\n def setUp(self):\n self.loader = Loade... | python | edit | 3 | 1 | bsd-3-clause | bfd34a7aaf903c823d41068173c09bc5b1a251bc | lewisodriscoll/sasview,lewisodriscoll/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview,SasView/sasview,SasView/sasview,lewisodriscoll/sasview | test/sasdataloader/test/utest_sesans.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom casexml.apps.case.util import get_datetime_case_property_changed\nfrom custom.enikshay.const import (\n ENROLLED_IN_PRIVATE,\n REAL_DATASET_PROPERTY_VALUE,\n)\n\n\nclass PrivateNikshayNotifiedDateSetter(object):\n \"\"\"Sets t... | python | edit | 1 | 4 | bsd-3-clause | ddad1cf5c4b90ad7997fee72ecd4949dafa43315 | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | custom/enikshay/model_migration_sets/private_nikshay_notifications.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom collections import OrderedDict\n\n\ndef form_questions(form):\n d = OrderedDict()\n children = form['children']\n for child in children:\n if 'pathstr' in child and 'control' not in child:\n d.update({child['... | python | edit | 1 | 16 | mit | 8d8863fe178b085c6ce7500996f9c2d2c8f159f6 | Code4SA/umibukela,Code4SA/umibukela,Code4SA/umibukela,Code4SA/umibukela | umibukela/csv_export.py | rejected_complexity | Cyclomatic complexity too high: 16 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom website.addons.osffiles.exceptions import FileNotFoundError\n\n\ndef get_versions(filename, node):\n \"\"\"Return file versions for a :class:`NodeFile`.\n\n :raises: FileNotFoundError if file does not exists for the node.\n \"... | python | edit | 1 | 2 | apache-2.0 | b17e39436bde57558c1a9d6e70330a51dd1d0d19 | bdyetton/prettychart,Johnetordoff/osf.io,caneruguz/osf.io,ZobairAlijan/osf.io,brandonPurvis/osf.io,arpitar/osf.io,GageGaskins/osf.io,DanielSBrown/osf.io,brianjgeiger/osf.io,fabianvf/osf.io,caseyrygt/osf.io,dplorimer/osf,MerlinZhang/osf.io,zkraime/osf.io,zkraime/osf.io,hmoco/osf.io,lamdnhan/osf.io,cosenal/osf.io,lyndsys... | website/addons/osffiles/utils.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os\nimport re\n\nos.sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport parsePoaXml\nimport generatePoaXml\n\n# Import test settings last in order to override the regular setting... | python | edit | 4 | 2 | mit | 3d38848287b168cfbe3c9fe5297e7f322027634d | gnott/elife-poa-xml-generation,gnott/elife-poa-xml-generation | tests/test_parsePoaXml_test.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"empty message\n\nRevision ID: 0165_another_letter_org\nRevises: 0164_add_organisation_to_service\nCreate Date: 2017-06-29 12:44:16.815039\n\n\"\"\"\n\n# revision identifiers, used by Alembic.\nrevision = '0165_another_letter_org'\ndow... | python | edit | 1 | 2 | mit | f4be8fd80b1aad9babdfbc56dec331af635f5554 | alphagov/notifications-api,alphagov/notifications-api | migrations/versions/0165_another_letter_org.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf8 -*-\n\nimport default_settings\nfrom flask.ext.plugins import Plugin\nfrom flask import current_app as app\nfrom pybossa_gravatar.gravatar import Gravatar\nfrom pybossa.model.user import User\nfrom sqlalchemy import event... | python | edit | 2 | 5 | bsd-3-clause | 0f9418eed089938e0094f40cc15682ef59e041a1 | alexandermendes/pybossa-gravatar | __init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport re\n\n\n\ndef register_filters():\n\t\"\"\"Register a function with decorator\"\"\"\n\tregistry = {}\n\tdef registrar(func):\n\t\tregistry[func.__name__] = func\n\t\treturn func \n\tregistrar.all = registry\n\treturn registrar\n\n\nf... | python | edit | 1 | 1 | apache-2.0 | f1099e777d2e14fa1429f72352dfd90fc08250e6 | reactiveops/pentagon,reactiveops/pentagon,reactiveops/pentagon | pentagon/filters.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Placeholder model for Zinnia\"\"\"\nimport inspect\n\nfrom cms.models.fields import PlaceholderField\nfrom cms.plugin_rendering import render_placeholder\n\nfrom zinnia.models.entry import EntryAbstractClass\n\n\nclass EntryPlaceholde... | python | edit | 1 | 7 | bsd-3-clause | 53d25950eb1ff21bb4488b60e802cb243735681f | django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia,bittner/cmsplugin-zinnia,django-blog-zinnia/cmsplugin-zinnia | cmsplugin_zinnia/placeholder.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\r\n\r\nfrom reporter.reports import Report, Schedule\r\nfrom reporter import get_case_link, RECIPIENT_BRICCS_ADMIN\r\n\r\n\r\nclass BriccsCivcrmBlankStudyId(Report):\r\n def __init__(self):\r\n super().__ini... | python | edit | 1 | 1 | mit | 666952b40005bf1695b5a5473c05d2e4b066f240 | LCBRU/reporter,LCBRU/reporter | reporter/reporter/reports/briccs/data_quality/blank_study_id.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .models import Monitoring\nfrom feder.users.factories import UserFactory\nimport factory\n\n\nclass MonitoringFactory(factory.django.DjangoModelFactory):\n name = factory.Sequence(lambda n: 'monitoring-%04d' % n)\n user = factory... | python | edit | 1 | 0 | mit | dd7513f4146679d11aff6d528f11927131dc692f | watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder,watchdogpolska/feder | feder/monitorings/factories.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom unittest import TestCase\n\nfrom pymemcache.serde import (python_memcache_serializer,\n python_memcache_deserializer)\n\n\nclass TestSerde(TestCase):\n\n def check(self, value):\n serialized, flag... | python | edit | 1 | 2 | apache-2.0 | b6c8921b7281f24f5e8353cd0542d7ca1d18cf37 | sontek/pymemcache,ewdurbin/pymemcache,sontek/pymemcache,bwalks/pymemcache,pinterest/pymemcache,pinterest/pymemcache | pymemcache/test/test_serde.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup\n\n\nsetup(\n name='tephi',\n version='0.2.0-alpha',\n url='https://github.com/SciTools/tephi',\n author='Bill Little',\n author_email='<EMAIL>',\n packages=['tephi', 'tephi.tests'],\n packa... | python | edit | 1 | 0 | bsd-3-clause | d486505f270125a4b5c7f460f4f39a9c1eab9a1f | SciTools/tephi | setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"\n\n\n\"\"\"\n# Author: Avraam Marimpis <<EMAIL>>\n\nfrom .ng import NeuralGas\nfrom .mng import MergeNeuralGas\nfrom .rng import RelationalNeuralGas\nfrom .gng import GrowingNeuralGas\nfrom .som import SOM\nf... | python | edit | 1 | 0 | bsd-3-clause | e8b50a70fc7de1842ebe8bc796736459bf154432 | makism/dyfunconn | dyconnmap/cluster/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport boto3.session\n\nfrom nubes.connectors import base\n\n\nclass AWSConnector(base.BaseConnector):\n\n def __init__(self, aws_access_key_id, aws_secret_access_key, region_name):\n self.connection = boto3.session.Session(\n ... | python | edit | 1 | 1 | apache-2.0 | 3856b48af3e83f49a66c0c29b81e0a80ad3248d9 | omninubes/nubes | nubes/connectors/aws/connector.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mne\nimport sys\n\nfrom mne import compute_covariance\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nfrom my_settings import *\n\nreject = dict(grad=4000e-13, # T / m (gradiometers)\n ma... | python | edit | 8 | 0 | bsd-3-clause | cd6429cd177e550d047408cc212b64648e0cbe6c | MadsJensen/CAA,MadsJensen/CAA | calc_cov.py | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nSYNTAX_BUILDABLE_EXPRESSIBLE_AS_CONFORMANCES = {\n 'DeclBuildable': [\n 'CodeBlockItem',\n 'MemberDeclListItem',\n 'SyntaxBuildable'\n ],\n 'ExprList': [\n 'ConditionElement',\n 'SyntaxBuildable'\... | python | edit | 1 | 0 | apache-2.0 | 030e129fd60b5ab2255b10e8115ab4e3e973ae05 | JGiola/swift,apple/swift,JGiola/swift,glessard/swift,apple/swift,ahoppen/swift,JGiola/swift,ahoppen/swift,ahoppen/swift,roambotics/swift,apple/swift,benlangmuir/swift,atrick/swift,atrick/swift,rudkx/swift,gregomni/swift,JGiola/swift,rudkx/swift,benlangmuir/swift,roambotics/swift,rudkx/swift,benlangmuir/swift,gregomni/s... | utils/gyb_syntax_support/protocolsMap.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport multiprocessing, sys, datetime\n\nprint_lock = multiprocessing.Lock()\ndef safeprint(content):\n with print_lock:\n sys.stdout.write((\"[\" + str(multiprocessing.current_process().pid) + \"] \" + datetime.datetime.now().strftime(... | python | edit | 1 | 1 | mit | 794a75ed410fe39ba2376ebcab75d21cc5e9fee0 | gappleto97/Senior-Project | common/safeprint.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom sharpy.product import CheddarProduct\n\n# Get a product instance to work with\nproduct = CheddarProduct(\n username = CHEDDAR_USERNAME,\n password = CHEDDAR_PASSWORD,\n product_code = CHEDDAR_PRODUCT,\n)\n\n# Get the customer ... | python | edit | 6 | 0 | bsd-3-clause | 73af60749ea7b031473bc5f0c3ddd60d39ec6fa6 | SeanOC/sharpy,smartfile/sharpy | docs/examples/customer_fetch/get_customer.py | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport mock\nimport sqlite3\n\nfrom matrixstore.connection import MatrixStore\nfrom matrixstore import db\nfrom matrixstore.tests.import_test_data_fast import import_test_data_fast\n\n\ndef matrixstore_from_data_factory(data_factory, end_da... | python | edit | 1 | 3 | mit | 8226571dc97230a486a3b59c8752411e038f04ee | annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing | openprescribing/matrixstore/tests/matrixstore_factory.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport string\n\ntemplate = string.Template(\"\"\"\n[global]\n;WEB_SERVER = 127.0.0.1\n;WEB_PORT = 9696 ; connection through quantum plugin\n\nWEB_SERVER = 127.0.0.1\nWEB_PORT = 8082 ; connection to api-server directly\nBASE_URL = /\n;BASE... | python | edit | 1 | 0 | apache-2.0 | 47e79b3a01ca4541d79412cdab856f84871e68f8 | Juniper/contrail-provisioning,Juniper/contrail-provisioning | templates/vnc_api_lib_ini_template.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom gi.repository import Gtk\nimport tempfile\nimport os.path\n\nversion = \"0.2.2\"\n\n# Define default port numbers\ndefault_socks_port = 19050\ndefault_control_port = 19051\n\n# Tor process descriptor placeholder\ntor_process = None\n\n... | python | edit | 1 | 0 | bsd-2-clause | a23e211ebdee849543cd7c729a8dafc145ea6b5c | neelchauhan/TorGTK,neelchauhan/TorNova | TorGTK/var.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Imports\nfrom .base import BasePlatform\n\nclass BitbucketPlatform(BasePlatform):\n PATTERNS = {\n 'https': r'https://(?P<_user>.+)@(?P<domain>.+)/(?P<owner>.+)/(?P<repo>.+).git',\n 'ssh': r'git@(?P<domain>.+)/(?P<owner>.... | python | edit | 1 | 0 | apache-2.0 | bcb8084cc5e84a6417d4e8580005b5f7cf614005 | FriendCode/giturlparse.py,yakky/giturlparse.py,yakky/giturlparse | giturlparse/platforms/bitbucket.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django import forms\n\nfrom payments.settings import PLAN_CHOICES\n\n\nclass PlanForm(forms.Form):\n \n plan = forms.ChoiceField(choices=PLAN_CHOICES + [(\"\", \"-------\")])\n\n```\n\nApply this change: Disable R0924 check on Pl... | python | edit | 1 | 0 | mit | a18f948a6b11522425aace5a591b5f622a5534d3 | crehana/django-stripe-payments,aibon/django-stripe-payments,jawed123/django-stripe-payments,aibon/django-stripe-payments,alexhayes/django-stripe-payments,adi-li/django-stripe-payments,alexhayes/django-stripe-payments,adi-li/django-stripe-payments,ZeevG/django-stripe-payments,jawed123/django-stripe-payments,grue/django-... | payments/forms.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\n\nfrom ..base import ModelLookup\nfrom ..registry import registry\n\n\nclass Thing(models.Model):\n name = models.CharField(max_length=100)\n description = models.CharField(max_length=100)\n\n def __un... | python | edit | 9 | 1 | bsd-2-clause | a88eb2c7fc2c2d875836f0a4c201ede0c082aceb | affan2/django-selectable,affan2/django-selectable,mlavin/django-selectable,mlavin/django-selectable,affan2/django-selectable,mlavin/django-selectable | selectable/tests/__init__.py | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.contrib import admin\n\nfrom .models import Discussion, Group\n\n\nadmin.site.register(Discussion)\nadmin.site.register(Group)\n\n```\n\nApply this change: Use filter_horizontal for many-to-many fields."
},
{
"role": "as... | python | edit | 1 | 0 | bsd-2-clause | 62a55c9e4c46aac647e0c7bc3d8143f1a6bd41ca | incuna/incuna-groups,incuna/incuna-groups | groups/admin.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n# -*- coding: utf-8 -*-\n'''Bookstore\n\nStores IPython notebooks automagically onto OpenStack clouds through Swift.\n'''\n\n__title__ = 'bookstore'\n__version__ = '1.0.0'\n__build__ = 0x010000\n__author__ = 'Kyle K... | python | edit | 3 | 0 | apache-2.0 | 77a6bb72318e9b02cbb1179cbbbacd3dd0bad55f | wusung/ipython-notebook-store | bookstore/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\nfrom selenium import webdriver\nimport unittest\n\n\nclass AdminPageTest(unittest.TestCase):\n\n def setUp(self):\n self.browser = webdriver.Firefox()\n self.browser.implicitly_wait(3)\n\n def t... | python | edit | 1 | 1 | mit | 08291f3948108da15b9832c495fade04cf2e22c4 | jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails,jake-jake-jake/cocktails | tests/tests.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom flask_wiki.backend.backend import api\nfrom flask_wiki.backend.views import PageView\n\napi.add_resource(PageView, '/pages-list', endpoint='pages-list')\n```\n\nApply this change: Support for page-detail url added."
},
{
"role"... | python | edit | 1 | 0 | bsd-2-clause | 6086b970e6c37ca4f343291a35bbb9e533109c1c | gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki,gcavalcante8808/flask-wiki | flask_wiki/backend/routes.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport sys\n\nPY2 = sys.version_info[0] == 2\nPY3 = sys.version_info[0] == 3\ndefault_encoding = \"UTF-8\"\n\ndef with_metaclass(meta, *bases):\n class metaclass(meta):\n __call__ = type.__call__\n ... | python | edit | 2 | 2 | apache-2.0 | 214d5f7e09e9b5e854e7471c6dc337456f428647 | ChrisRx/quickavro,ChrisRx/quickavro | quickavro/_compat.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport random\nfrom enum import Enum\nfrom enum34_custom import _MultiValueMeta, OrderableMixin, CaseInsensitiveMultiValueEnum\nfrom types import DynamicClassAttribute\n\n\nclass _MultiMeta(_MultiValueMeta):\n def make_random(cls):\n ... | python | edit | 3 | 2 | mit | 2bef67ad0a4fb0db4bdf11d24b3c63e37558e7b9 | pokerregion/poker,Seanmcn/poker,marchon/poker | poker/_common.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom .models import Challenge, Role\nfrom core.serializers import UserSerializer\n#from comments.serializers import HeadCommentSerializer, TailCommentSerializer\n\n\n\nclass ChallengeSerializer(seri... | python | edit | 3 | 0 | mit | 1c26d3e2237d731024fe5c9494c2da7e0867653d | robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth,robrechtdr/inonemonth | inonemonth/challenges/serializers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom http_client import HttpClient\n\nclass Bot():\n \"\"\"\n @brief Facebook messenger bot\n \"\"\"\n\n def __init__(self, token):\n self.api_token = token\n self.client = HttpClient()\n\n def send_message(self... | python | edit | 5 | 2 | mit | b19330abc312c8bdfa66d46b8ed9f8541a371b6b | ben-cunningham/pybot,ben-cunningham/python-messenger-bot | fbmsgbot/bot.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nThis module is used to manage optional dependencies.\n\nExample usage::\n\n from birdy.dependencies import ipywidgets as widgets\n\"\"\"\n\nimport warnings\nfrom .exceptions import IPythonWarning\n\n# T... | python | edit | 1 | 0 | apache-2.0 | 379c083be77ba5373881f84adf7d2a8e87e930f4 | bird-house/birdy | birdy/dependencies.py | rejected_duplicate | Near-duplicate of sample 4880 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport brainfuck\nimport scrypt\nimport prng\n\ndef hash(password, salt):\n k0 = scrypt.hash(password, salt, 512, 4, 8, 96)\n code_key = k0[ 0:32]\n data_key = k0[32:64]\n code_iv = k0[64:80]\n data_iv = k0[80:96]\n code... | python | edit | 1 | 3 | unlicense | 0e6253bb0f06ebd4bf81c9e06037398899e37328 | stribika/bfkdf | main/bfkdf.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\nfrom django.urls import (\n include,\n path,\n)\n\nBASE_DIR = os.path.dirname(__file__)\nSTATIC_URL = \"/static/\"\n\nINSTALLED_APPS = (\n 'gcloudc',\n 'djangae',\n 'djangae.commands', # Takes care of emulator s... | python | edit | 1 | 0 | bsd-3-clause | d613ca02bef0572d7581c843eb5466443410decf | potatolondon/djangae,potatolondon/djangae | test_settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n name=\"pdtools\",\n version='0.8.0',\n author=\"ParaDrop Labs\",\n description=\"ParaDrop development tools\",\n install_requires=[\n 'click>=6.7',\n 'futu... | python | edit | 1 | 0 | apache-2.0 | b256f2733d32b55e6a3a7ebfa1300b1a13555bab | ParadropLabs/Paradrop,ParadropLabs/Paradrop,ParadropLabs/Paradrop | tools/pdtools/setup.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport click\nimport pytest\n\nfrom cookiecutter.compat import read_user_choice\n\nOPTIONS = ['hello', 'world', 'foo', 'bar']\n\n\nEXPECTED_PROMPT = \"\"\"Select varname:\n1 - hello\n2 - world\n3 - foo\n4 - bar\nC... | python | edit | 1 | 1 | bsd-3-clause | c3b1f8c97f89e5b9e8b8e74992631bac33bdde5f | lucius-feng/cookiecutter,foodszhang/cookiecutter,tylerdave/cookiecutter,atlassian/cookiecutter,kkujawinski/cookiecutter,Vauxoo/cookiecutter,sp1rs/cookiecutter,pjbull/cookiecutter,dajose/cookiecutter,benthomasson/cookiecutter,luzfcb/cookiecutter,stevepiercy/cookiecutter,luzfcb/cookiecutter,foodszhang/cookiecutter,vintas... | tests/test_read_user_choice.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport logging\n\nfrom lib.config import Config\nfrom lib.sources.decklinkavsource import DeckLinkAVSource\nfrom lib.sources.imgvsource import ImgVSource\nfrom lib.sources.tcpavsource import TCPAVSource\nfrom lib.sources.testsource import T... | python | edit | 1 | 6 | mit | 6099451fe088fe74945bbeedeeee66896bd7ff3d | voc/voctomix,voc/voctomix | voctocore/lib/sources/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime\n\nGAME_VIDEO_BASE_URL = \"http://www.nfl.com/feeds-rs/videos/byGameCenter/{0}.json\"\nLIVE_UPDATE_BASE_URL = \"http://www.nfl.com/liveupdate/game-center/{0}/{0}_gtd.json\"\n\n\nclass Game(object):\n\n def _... | python | edit | 1 | 1 | apache-2.0 | 17bd35d7a2b442faebdb39aad07294612d8e7038 | twbarber/nfl-highlight-bot | nflh/games.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls.defaults import patterns, url\n\nfrom flicks.videos import views\n\nurlpatterns = patterns('',\n url(r'^video/(?P<video_id>[\\w]+)$', views.details,\n name='flicks.videos.details'),\n url(r'^add_view/?$', ... | python | edit | 1 | 0 | bsd-3-clause | 4d3ec7b3844d770925601342b0bc4a4cd6d2c852 | mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks | flicks/videos/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nAUTHENTICATION_BACKENDS = (\n 'django.contrib.auth.backends.ModelBackend',\n 'lib.pam_backend.PamBackend',\n)\n\nAUTH_USER_MODEL = 'accounts.User'\n\nLOGIN_URL = '/login'\n\nPAM_SERVICES = {\n 'default': 'curc-twofactor-duo',\n ... | python | edit | 1 | 0 | mit | bf1f62cb7d91458e768ac31c26deb9ff67ff3a1e | ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP,ResearchComputing/RCAMP | rcamp/rcamp/settings/auth.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nfrom django.core.urlresolvers import reverse\n\nfrom sentry.testutils import TestCase, PermissionTestCase\n\n\nclass OrganizationHomePermissionTest(PermissionTestCase):\n def setUp(self):\n ... | python | edit | 1 | 1 | bsd-3-clause | c266f5171e875d8dc3abe924e4b6c9ed2a486422 | drcapulet/sentry,daevaorn/sentry,ifduyue/sentry,hongliang5623/sentry,Natim/sentry,wujuguang/sentry,jokey2k/sentry,korealerts1/sentry,llonchj/sentry,songyi199111/sentry,vperron/sentry,BayanGroup/sentry,BuildingLink/sentry,kevinlondon/sentry,fotinakis/sentry,imankulov/sentry,korealerts1/sentry,boneyao/sentry,jean/sentry,... | tests/sentry/web/frontend/test_organization_home.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport pytest\nimport os\nimport mock\nimport json\n\nimport app.mapping\n\n\nwith open(os.path.join(os.path.dirname(__file__), 'fixtures/mappings/services.json')) as f:\n _services_mapping_defin... | python | edit | 1 | 1 | mit | c0df1342b6625cdc2a205f2ba13ee201e8d0b02a | alphagov/digitalmarketplace-search-api,alphagov/digitalmarketplace-search-api | tests/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport graphene\nfrom graphene_django import DjangoObjectType\n\nfrom app import models\n\n\n\nclass TagType(DjangoObjectType):\n class Meta:\n model = models.Tag\n interfaces = (graphene.relay.Node,)\n\n @classmethod\n ... | python | edit | 1 | 1 | mit | 741db5b16922ceca0c23a95caa143f9ff7baeee2 | rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info,rcatlin/ryancatlin-info | Api/app/types.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# ############# version ##################\nfrom pkg_resources import get_distribution, DistributionNotFound\nimport os.path\nimport subprocess\ntry:\n _dist = get_distribution('pyethapp')\n # Normalize case f... | python | edit | 1 | 0 | mit | 72f763d9759438abd731585a1b5ef67e62e27181 | gsalgado/pyethapp,RomanZacharia/pyethapp,ethereum/pyethapp,RomanZacharia/pyethapp,ethereum/pyethapp,changwu-tw/pyethapp,changwu-tw/pyethapp,gsalgado/pyethapp | pyethapp/__init__.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom framework.celery_tasks import app as celery_app\nfrom scripts.analytics.base import DateAnalyticsHarness\nfrom scripts.analytics.node_log_events import NodeLogEvents\n\n\nclass EventAnalyticsHarness(DateAnalyticsHarness):\n\n @prope... | python | edit | 1 | 1 | apache-2.0 | ef67ce4372128d8f7e9689e1090ee44674c8f391 | chrisseto/osf.io,caneruguz/osf.io,felliott/osf.io,alexschiller/osf.io,leb2dg/osf.io,chrisseto/osf.io,caseyrollins/osf.io,baylee-d/osf.io,icereval/osf.io,hmoco/osf.io,leb2dg/osf.io,chrisseto/osf.io,mluo613/osf.io,rdhyee/osf.io,acshi/osf.io,mluo613/osf.io,Nesiehr/osf.io,CenterForOpenScience/osf.io,rdhyee/osf.io,felliott/... | scripts/analytics/run_keen_events.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom models import Post\n\ndef get_post_url(post):\n post_year = str(post.publication_date.year)\n post_month = '%02d' % post.publication_date.month\n post_title = post.title\n url = u'/blog/' + post_year + '/' + post_month + '/... | python | edit | 3 | 1 | mit | d7d2361bb27c8649e38b61b65ba193e5ea716ed5 | Lukasa/minimalog | blog/posts/helpers.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#!/usr/bin/env python3\n\n\"\"\"This is a **proof-of-concept** CLion project generator.\"\"\"\n\nimport functools\nimport json\nimport subprocess\n\nsubprocess.check_call(['cook', '--results'])\n\nwith open('results.json') as file:\n con... | python | edit | 1 | 0 | mit | f16ce4235e124fa9ea5d335665221514a2fcdcce | jachris/cook | examples/cpp/clion.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom PIL import Image\nimport stepic\nimport sys\nimport os\n\nfrom moviepy.editor import *\nimport moviepy.editor as mpy \nfrom moviepy.editor import VideoFileClip\n\nos.chdir(\"videos\")\n\ndef encrypt_video(filename, userinfo):\n\t# Orig... | python | edit | 7 | 1 | apache-2.0 | 9691ff0a1fa5fee4895cc5cff33ca169498dbbc6 | AntiPiracy/webapp,tcyrus-hackathon/scurvy-webapp,AntiPiracy/webapp,tcyrus-hackathon/scurvy-webapp,tcyrus-hackathon/scurvy-webapp,AntiPiracy/webapp | encrypt.py | rejected_lint | Too many lint violations: 7 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom .model import Model\n\n\nclass FeedForward(Model):\n '''A feed-forward network, that chains multiple Model instances together.'''\n def __init__(self, layers, **kwargs):\n Model.__init__(self, **kwargs)\n self.layer... | python | edit | 1 | 3 | mit | 5d6206f42323c9fd5e4185f36e75a2466adf79e8 | explosion/thinc,spacy-io/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc | thinc/neural/_classes/feed_forward.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom keras.layers import LSTM, Input, Reshape\nfrom keras.models import Model\n\nfrom ..layers import LMMask, Projection\n\n\nclass LanguageModel(Model):\n def __init__(self, n_batch, d_W, d_L, trainable=True):\n \"\"\"\n n_batch ... | python | edit | 1 | 1 | mit | f5fb36875b09926effdae46a92497d01fa04e777 | milankinen/c2w2c,milankinen/c2w2c | src/models/lm.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport sys\nimport traceback\n\nimport gunicorn\nfrom gds_metrics.gunicorn import child_exit # noqa\n\nworkers = 5\nworker_class = \"eventlet\"\nerrorlog = \"/home/vcap/logs/gunicorn_error.log\"\nbind = \"0.0.0.0:{}\".format(os.... | python | edit | 1 | 2 | mit | 43a2f2f27110f45e8a0d19004dac097ae67949c9 | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | gunicorn_config.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport unittest\nimport os, sys\n\nPROJECT_ROOT = os.path.dirname(__file__)\nsys.path.append(os.path.join(PROJECT_ROOT, \"..\"))\n\nfrom CodeConverter import CodeConverter\n\nclass TestBasic(unittest.TestCase):\n def setUp(self):\n ... | python | edit | 1 | 1 | mit | 9fbef73081b0cb608e32c91a57502aaefa0599cc | kyamaguchi/SublimeObjC2RubyMotion,kyamaguchi/SublimeObjC2RubyMotion | tests/test_basic.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport sys\nsys._running_pytest = True\n\nfrom sympy.core.cache import clear_cache\n\ndef pytest_terminal_summary(terminalreporter):\n if (terminalreporter.stats.get('error', None) or\n terminalreporter.stats.get('failed', Non... | python | edit | 1 | 3 | bsd-3-clause | 4bd930b8bc6410a9966327c8e73e0b1849c71157 | moble/sympy,ahhda/sympy,chaffra/sympy,saurabhjn76/sympy,saurabhjn76/sympy,ga7g08/sympy,AkademieOlympia/sympy,sampadsaha5/sympy,hrashk/sympy,jbbskinny/sympy,chaffra/sympy,yukoba/sympy,Designist/sympy,abhiii5459/sympy,atsao72/sympy,pandeyadarsh/sympy,kevalds51/sympy,postvakje/sympy,sahmed95/sympy,beni55/sympy,Vishluck/sy... | sympy/conftest.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom pyspark.sql.functions import udf\nfrom pyspark.sql.types import *\nfrom pyspark.sql import DataFrame\nimport sys\nimport sparknlp\n\n\ndef map_annotations(f, output_type: DataType):\n sys.modules['sparknlp.annotation'] = sparknlp #... | python | edit | 5 | 1 | apache-2.0 | 27112881583e53d790e66d31a2bb4d2a996ee405 | JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp | python/sparknlp/functions.py | rejected_lint | Too many lint violations: 5 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n#! /usr/bin/python2\n\nfrom os.path import expanduser,isfile\nfrom sys import argv\nfrom urllib import urlopen\n\nlocation_path=\"~/.location\"\n\ndef location_from_homedir():\n if isfile(expanduser(location_path)):\n with open(ex... | python | edit | 3 | 2 | mit | 970978b5355259fe943d5efed1b8b4ce945fdfa7 | robbystk/weather | weather.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.db import models\nfrom django.template.defaultfilters import slugify\nfrom django.core.urlresolvers import reverse_lazy\n\nclass Category(models.Model):\n title = models.CharField(max_length=80)\n\n class Meta:\n ve... | python | edit | 1 | 2 | mit | e27088976467dd95ad2672123cb39dd54b78f413 | jmcomets/jmcomets.github.io | blog/models.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom django.conf.urls import patterns, url\nfrom django.views.generic import TemplateView\n\nfrom .views import (\n PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,\n PizzaUpdateView,\n ChickenWingsListView\n)\n\nu... | python | edit | 1 | 0 | bsd-3-clause | d8702486851c59d8b030a63aefee2b5ca152772e | kelvinwong-ca/django-select-multiple-field,kelvinwong-ca/django-select-multiple-field,kelvinwong-ca/django-select-multiple-field | test_projects/django14/pizzagigi/urls.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\n\nimport os\n\nfrom flask.ext.sqlalchemy import SQLAlchemy\nfrom flask.ext.images import Images\n# from flask.ext.mail import Mail\nfrom flask.ext.login import LoginManager\nfrom flask.ext.acl import ... | python | edit | 3 | 1 | bsd-3-clause | 3cff942af436f16aab2078e6aeedd3073f4a5522 | mikeboers/Flask-Roots,mikeboers/Flask-Roots | flask_roots/extension.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\n\"\"\"\nMAP Client Plugin\n\"\"\"\n\n__version__ = '0.2.0'\n__author__ = 'Richard Christie'\n__stepname__ = 'Mesh Generator'\n__location__ = ''\n\n# import class that derives itself from the step mountpoint.\nfrom mapclientplugins.meshgen... | python | edit | 4 | 0 | apache-2.0 | 2ba28c83de33ebc75f386d127d0c55e17248a94b | rchristie/mapclientplugins.meshgeneratorstep | mapclientplugins/meshgeneratorstep/__init__.py | rejected_lint | Too many lint violations: 4 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n# Here we define a set of hardcoded keys that we use when denormalizing data from Supplier/ContactInformation tables\n# into the SupplierFramework.declaration field. These are used only by the API and by the\n# `digitalmarketplace-scripts/s... | python | edit | 1 | 0 | mit | 422bb9ebfcff9826cf58d17a20df61cea21fdd77 | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | app/supplier_constants.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\nimport photomosaic.flickr\nimport photomosaic as pm\n\n\nif not os.path.isfile('~/pools/cats/pool.json'):\n FLICKR_API_KEY = os.environ['FLICKR_API_KEY']\n pm.set_options(flickr_api_key=FLICKR_API_KEY)\n\n photomosaic.fl... | python | edit | 1 | 0 | bsd-3-clause | 2d09314ab58bb766372dc6e263fb17428b1fd3cd | danielballan/photomosaic | doc/pool_scripts/cats.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom datetime import datetime, timedelta\nimport jwt\nimport os\n\n\nfrom django.shortcuts import render\nfrom django.conf import settings\nfrom django.views.generic.base import TemplateView\n\n\nkey = os.path.join(\n os.path.dirname(__f... | python | edit | 3 | 1 | mit | b874a5d3f54ef7ba71af18474a96e835d97bb846 | Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters | chat/views.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\ndef product(nums):\n r = 1\n for n in nums:\n r *= n\n return r\n\ndef choose(n, k):\n if 0 <= k <= n:\n ntok = 1\n ktok = 1\n for t in range(1, min(k, n - k) + 1):\n ntok *= n\n ... | python | edit | 1 | 3 | unlicense | 73ff56f4b8859e82b0d69a6505c982e26de27859 | joseph346/cellular | util.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"\n\nVery basic implementation of an event loop\n==========================================\n\nThe eventloop is a singleton to schedule and run events.\n\nExports\n-------\n\n- ``EventLoop``: the basic eventloop\n\n\"\"\"\n\nimport que... | python | edit | 3 | 2 | mit | b9a7289c1f3466bb0caee1488a16dafbae327c6f | waltermoreira/tartpy | tartpy/eventloop.py | rejected_duplicate | Near-duplicate of sample 388 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nclass StackFrame(object):\n\n def __init__(self, instance):\n self.instance = instance\n self.data = {}\n self.idx = 0\n self.return_value = None\n\n def __setitem__(self, key, value):\n print('\\tSE... | python | edit | null | null | mit | ff59a35d5ea90169e34d65bd9ec3a6177e1faebd | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | thinglang/execution/stack.py | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''\nAbstraction of TinyDB table for storing config\n'''\nfrom tinydb import Query\n\n\nclass KeyValueTable:\n \"\"\"Wrapper around a TinyDB table.\n\n \"\"\"\n\n def __init__(self, tdb, name='_default'):\n self.table = tdb.... | python | edit | 1 | 2 | mit | 1b33866dd7f140efa035dfd32e0a912dfcf60f35 | randomic/antinub-gregbot | utils/kvtable.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nfrom itertools import dropwhile, count, cycle\nimport random\n\n\ndef geometric(p):\n return (next(dropwhile(lambda _: random.randint(1, int(1. / p)) == 1, count())) for _ in cycle([1]))\n\n\ndef uniform(n):\n \"\"\"\n Simple deter... | python | edit | 1 | 2 | mit | 88e0ec5ff58f7dabb531749472a410498c8e7827 | ZhukovAlexander/skiplist-python | py_skiplist/iterators.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\"\"\"\n exc.py\n ~~~~~~\n\n Exceptions for TAP file handling.\n\n (c) BSD 3-clause.\n\"\"\"\n\nfrom __future__ import division, absolute_import\nfrom __future__ import print_fun... | python | edit | 2 | 2 | bsd-3-clause | f992c901748787acb4f3235b46e27488967b9a60 | meisterluk/taptaptap,meisterluk/taptaptap | taptaptap/exc.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n'''A custom rq worker class to add start & stop SNS messages to all jobs'''\n\nimport logging\nfrom rq.worker import Worker\nfrom harvester.sns_message import publish_to_harvesting\n\nlogger = logging.getLogger(__name__)\n\n\nclass SNSWorke... | python | edit | 3 | 1 | bsd-3-clause | fe65e85e0a29341a6eebbb1bafb28b8d1225abfc | mredar/harvester,barbarahui/harvester,barbarahui/harvester,mredar/harvester,ucldc/harvester,ucldc/harvester | harvester/rq_worker_sns_msgs.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\nimport os\n\ntemplate_header = \"\"\"<html>\n<head><title>Littlefield Charts</title></head>\n<body>\n<table>\"\"\"\n\ntemplate_footer = \"\"\"</table>\n<p><a href=\"production.csv\">Download production data</a></p>\n<p><a href=\"rankings.cs... | python | edit | 1 | 0 | mit | 16c0a0341ad61b164b5d2bf750b6f5319c74b245 | eallrich/littlefield,eallrich/littlefield | refresh_html.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n\"\"\"Settings for POET application.\"\"\"\n\nNUM_RESOURCES_PER_FORM = 3\nMINIMUM_SUBMISSIONS_PER_RESOURCE = 10\n\n```\n\nApply this change: Increase threshold for showing resource submissions"
},
{
"role": "assistant",
"content... | python | edit | 1 | 0 | mit | 0d3b274d220a9bc229d3ed7c14b231b21d5c8299 | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | dthm4kaiako/poet/settings.py | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```python\n__all__ = [\n 'create_engine',\n]\n\nimport sqlalchemy\n\n\ndef create_engine(\n db_uri, *,\n check_same_thread=False,\n echo=False,\n pragmas=()):\n\n engine = sqlalchemy.create_engine(\n db_uri,\n ... | python | edit | 1 | 2 | mit | 16630b23238ee66c8e4ca6017db934befc6ab71e | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | py/garage/garage/sql/sqlite.py | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.