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# Handles queries to the LDAP backend\n# Reads the LDAP server configuration from a JSON file\n\nimport json\nimport ldap\n\nfirst_connect = True\n# The default config filename\nconfig_file = 'config.json'\n\ndef load_config():\n with op...
python
edit
5
6
mit
1d017e9e07e48a8a1960de4c16fd49b4b40abbc2
motorolja/ldap-updater
ldap-helper.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# -*- coding: utf-8 -*-\n\n__title__ = 'pyhn'\n__version__ = '0.2.7'\n__author__ = 'Geoffrey Lehée'\n__license__ = 'AGPL3'\n__copyright__ = 'Copyright 2014 Geoffrey Lehée'\n\n```\n\nApply this change: Update license a...
python
edit
1
0
mit
9938f0b70e4714fb6e74deb14a751368edd5d48f
toxinu/pyhn,socketubs/pyhn
pyhn/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nfrom flask import Flask, send_file\napp = Flask(__name__)\n\n\n@app.route(\"/hello\")\ndef hello():\n return \"Hello World from Flask in a uWSGI Nginx Docker container with \\\n Python 3.6 (from the example template)\"\n...
python
edit
1
2
apache-2.0
62d3f84155291bf020870b618cf139d8333a04cd
tiangolo/uwsgi-nginx-flask-docker,tiangolo/uwsgi-nginx-flask-docker,tiangolo/uwsgi-nginx-flask-docker
example-flask-python3.6-index/app/main.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom electro.errors import ResourceDuplicatedDefinedError\n\nclass API(object):\n\n def __init__(self, app=None, decorators=None,\n catch_all_404s=None):\n self.app = app\n self.endpoin...
python
edit
1
6
mit
6bfe3ee375847d9a71181d618732d747614aede4
soasme/electro
electro/api.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nCLI Entry point for respawn\n\"\"\"\n\nfrom docopt import docopt\nfrom schema import Schema, Use, Or\nfrom subprocess import check_call, CalledProcessError\nfrom pkg_resources import require\nimport respawn\n\n\ndef generate():\n ...
python
edit
1
2
isc
2a241bd07a4abd66656e3fb505310798f398db7f
dowjones/respawn,dowjones/respawn
respawn/cli.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nimport testinfra.utils.ansible_runner\n\ntestinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(\n os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')\n\ndef test_service_elasticsearch_running(host):\n assert ...
python
edit
1
3
apache-2.0
6795e8f5c97ba2f10d05725faf4999cfba785fdd
Graylog2/graylog-ansible-role
molecule/default/tests/test_default.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nimport os\n\nfrom cmt.printers.nc.read import field_fromfile\n\n\nclass DataTestFileMixIn(object):\n def data_file(self, name):\n return os.path.join(self.data_dir(), name)\n\n def data_dir(self):\n retu...
python
edit
6
1
mit
4443f6d2493ce6ff9d49cf4049c6a89d2a61eddf
csdms/coupling,csdms/coupling,csdms/pymt
cmt/printers/nc/tests/test_ugrid_read.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom kat.harness import Runner\n\nfrom abstract_tests import AmbassadorTest\n\n# Import all the real tests from other files, to make it easier to pick and choose during development.\n\nimport t_basics\nimport t_cors\nimport t_extauth\nimpor...
python
edit
25
0
apache-2.0
06e96684b589def7b7adce122005ffebbf0ed7f3
datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador
python/tests/test_ambassador.py
rejected_lint
Too many lint violations: 25
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"\n\nfrom django.test import TestCase\n\n\ncla...
python
edit
1
1
bsd-3-clause
70458f45f3419927271f51872252834f08ef13f2
andreagrandi/workshopvenues
workshopvenues/venues/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Write data out to console.\"\"\"\n\nfrom __future__ import print_function\nimport sys\n\n\ndef abnormal_exit():\n \"\"\"Exits program under abnormal conditions.\"\"\"\n sys.exit(1)\n\n\ndef error_message(message):\n \"\"\"Wri...
python
edit
1
2
apache-2.0
f267b56b46a824fa5b519a22b3026d2b3c6ee106
Jitsusama/hostel-huptainer
source/hostel_huptainer/system.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import absolute_import\nfrom .base import * # noqa: ignore=F403\n\n\n# dev overrides\nDEBUG = False\nIS_STAGING = True\n\nMEDIA_ROOT = os.path.join(BASE_DIR, '%s' % UPLOADS_DIR_NAME)\nSTATIC_ROOT = '%s/staticserve' % BASE_D...
python
edit
2
0
apache-2.0
8dc6e5632ecbab6143e25f403022ae068fbb24a2
unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal,unicef/un-partner-portal
backend/unpp_api/settings/staging.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom django import forms\nfrom crispy_forms.helper import FormHelper\nfrom crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder\nfrom Instanssi.store.models import StoreItem\n\n\nclass StoreItemForm(f...
python
edit
1
1
mit
0d2525de51edd99b821f32b3bfd962f3d673a6e1
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
Instanssi/admin_store/forms.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Download the Python helper library from twilio.com/docs/python/install\nfrom twilio.rest import Client\n\n# Your Account Sid and Auth Token can be found at https://www.twilio.com/console\naccount_sid = \"AC6062f793ce5918fef56b1681e6446e87...
python
edit
1
0
mit
00fc915c09e0052289fa28d7da174e44f838c15b
TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets
quickstart/python/voice/example-1-make-call/outgoing_call.6.x.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport socket\nimport sys\n\n\ndef client(msg):\n client_socket = socket.socket(\n socket.AF_INET,\n socket.SOCK_STREAM,\n socket.IPPROTO_IP)\n client_socket.connect(('127.0.0.1', 50000))\n\n # sends command li...
python
edit
2
2
mit
2307942c6e29ae24d6d4fdc42a646e4f6843fca8
jwarren116/network-tools,jwarren116/network-tools
echo_client.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nclass APIObject(object):\n\n def __init__(self, client, json_data):\n super(APIObject, self).__init__()\n self.client = client\n self._data = json_data\n\n def __eq__(self, other):\n if not isinstance(oth...
python
edit
1
3
bsd-3-clause
ce963503cea617cb552739b49caeba450e5fb55e
slash-testing/backslash-python,vmalloc/backslash-python
backslash/api_object.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n# simple script to publish a image from a file.\nimport rospy\nimport cv2\nimport sensor_msgs.msg\n\n#change these to fit the expected topic names\nIMAGE_MESSAGE_TOPIC = 'grid_map_image'\nIMAGE_PATH = 'test2.png'\n\nd...
python
edit
1
1
bsd-3-clause
6e4daa3745cf51443550d559493a0cf8c2dbd8f1
uzh-rpg/grid_map,chen0510566/grid_map,ANYbotics/grid_map,ysonggit/grid_map,ANYbotics/grid_map,ysonggit/grid_map,ethz-asl/grid_map,ethz-asl/grid_map,uzh-rpg/grid_map,chen0510566/grid_map
grid_map_demos/scripts/image_publisher.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.contrib.auth.models import *\nfrom django.contrib.auth.backends import ModelBackend\nfrom django.utils.translation import ugettext_lazy as _\nfrom OctaHomeCore.basemodels import *\nfrom OctaHomeCore.authmodels import *\n\nimport...
python
edit
12
2
mit
8d789a822a34f59d79f0e1129ab7ce5fa945a746
Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation
OctaHomeAppInterface/models.py
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nfrom ..filters import *\nfrom ..widgets import BooleanWidget\n\n\nclass BooleanFilter(BooleanFilter):\n def __init__(self, *args, **kwargs):\n kwargs.setdefault('widget', BooleanWidget)\n\n super().__init__(*args, **kwarg...
python
edit
2
1
bsd-3-clause
7bc736b9a31d532930e9824842f7adb84436a7b8
alex/django-filter,alex/django-filter
django_filters/rest_framework/filters.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# http://robohash.org/\n\nfrom django import template\nfrom md5 import md5\n\n\nregister = template.Library()\n\n\n@register.inclusion_tag(\"robotars/robotar.html\")\ndef robotar(user, size=None, gravatar_fallback=False, hashed=False):\n ...
python
edit
1
4
bsd-3-clause
a8070975c31aef61d722de93b7104b09f853e02d
eldarion/robotars
robotars/templatetags/robotars_tags.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport json\nimport requests\nimport subprocess\n\nfrom flask import Flask\nfrom flask import render_template\n\napp = Flask(__name__)\nconfig = {}\n\n\ndef shell_handler(command, **kwargs):\n return_code = subprocess.call(command, shell...
python
edit
1
2
mit
455b77877e2a3ee7f795ab969ed70ddc3dd8c531
xhacker/miracle-board,huangtao728/miracle-board,matthewbaggett/miracle-board,xhacker/miracle-board,matthewbaggett/miracle-board,huangtao728/miracle-board,forblackking/miracle-board,forblackking/miracle-board
hello.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nCopyright [2009-2019] EMBL-European Bioinformatics Institute\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 copy of the License ...
python
edit
1
0
apache-2.0
3c87312aa5605e2705257052d38a4c8fae705da3
RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode,RNAcentral/rnacentral-webcode
rnacentral/sequence_search/settings.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright 2017-2018 TensorHub, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.ap...
python
edit
1
2
apache-2.0
1ccf85b257d0774f6383a5e9dc6fdb43a20400ea
guildai/guild,guildai/guild,guildai/guild,guildai/guild
guild/commands/download_impl.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Rename audio files from metadata tags.\"\"\"\n\nimport sys\n\nfrom .args import fields, parse_args\nfrom .batch import Batch\nfrom .job import Job\nfrom .message import job_info, stats\n\nfields\n\n__version__: str = '0.0.0'\n\n\ndef ...
python
edit
1
7
mit
d7ce69c7b07782902970a9b21713295f6b1f59ad
Josef-Friedrich/audiorename
audiorename/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# pylint: disable=no-value-for-parameter\n\nfrom django.conf import settings\nfrom django.conf.urls import patterns, url, include\nfrom django.contrib import admin\nfrom django.views.generic import RedirectView\n\n# Enable admin.\nadmin.aut...
python
edit
1
0
mit
4d4b412bf67b782fc35d12531a9263c38230a96b
ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser
cloud_browser_project/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom scikits.audiolab import Sndfile\nimport matplotlib.pyplot as plt\nimport os\n\ndt = 0.05\nFs = int(1.0/dt)\n\ncurrent_dir = os.path.dirname(__file__)\n\nfor (dirpath, dirnames, filenames) in os.walk(current_dir):\n for filename in f...
python
edit
21
0
mit
fd5742bf48691897640d117330d3c1f89276e907
ritazh/EchoML,ritazh/EchoML,ritazh/EchoML
fft/convert.py
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport os\nimport sys\n\nif sys.ver...
python
edit
1
3
bsd-3-clause
dd27eea0ea43447dad321b4b9ec88f24e5ada268
pv/asv,mdboom/asv,airspeed-velocity/asv,waylonflinn/asv,airspeed-velocity/asv,giltis/asv,cpcloud/asv,spacetelescope/asv,mdboom/asv,giltis/asv,edisongustavo/asv,qwhelan/asv,airspeed-velocity/asv,pv/asv,cpcloud/asv,airspeed-velocity/asv,spacetelescope/asv,mdboom/asv,ericdill/asv,ericdill/asv,pv/asv,cpcloud/asv,mdboom/asv...
asv/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Utilities to read and write images in various formats.\"\"\"\n\nfrom _plugins import load as load_plugin\nfrom _plugins import use as use_plugin\nfrom _plugins import available as plugins\n\n# Add this plugin so that we can read image...
python
edit
6
5
bsd-3-clause
0a1056bd1629cc5c2423b83cf1d667ba46274fc9
oew1v07/scikit-image,oew1v07/scikit-image,WarrenWeckesser/scikits-image,ClinicalGraphics/scikit-image,vighneshbirodkar/scikit-image,paalge/scikit-image,GaZ3ll3/scikit-image,almarklein/scikit-image,robintw/scikit-image,GaelVaroquaux/scikits.image,keflavich/scikit-image,SamHames/scikit-image,almarklein/scikit-image,Warre...
scikits/image/io/__init__.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\n\nimport yaml\nfrom git import Repo\n\n\nclass GitCv:\n def __init__(self, cv_path, repo_path):\n self._cv = self._load_cv(cv_path)\n self._repo_path = os.path.join(repo_path, 'cv')\n\n def _load_cv(self, cv_p...
python
edit
1
3
mit
16c567f27e1e4979321d319ddb334c263b43443f
jangroth/git-cv,jangroth/git-cv
gitcv/gitcv.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2015 Mirantis, Inc.\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 of the License at\n#\n# http://www.apac...
python
edit
1
3
apache-2.0
0f42038436fae01e248bbf86c5d52f7cdfe97fdc
openstack/python-ironicclient,NaohiroTamura/python-ironicclient,NaohiroTamura/python-ironicclient,openstack/python-ironicclient
ironicclient/tests/functional/utils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# left out assignment for types_of_people mentioned in intro\ntypes_of_people = 10\n# change variable from 10 to types_of_people\nx = f\"There are {types_of_people} types of people.\"\n\nbinary = \"binary\"\ndo_not = \"don't\"\ny = f\"Those...
python
edit
1
0
mit
84e9995668d8c34993b9fdf1a95f187897328750
zedshaw/learn-python3-thw-code,zedshaw/learn-python3-thw-code,zedshaw/learn-python3-thw-code
ex6.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom gratipay.wireup import db, env\nfrom gratipay.models.team import migrate_all_tips\n\ndb = db(env())\n\nif __name__ == '__main__':\n migrate_all_tips(db)\n\n```\n\nApply this change: Fix imports in tip migration script" }, { ...
python
edit
1
0
mit
e081c1944506330a3c01cfe90dcf8deb242bd63b
gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/gratipay.com
bin/migrate-tips.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom apps.approval.models import CommitteeApplication, CommitteePriority\n\n\nclass CommitteeSerializer(serializers.ModelSerializer):\n group_name = serializers.SerializerMethodField(source='grou...
python
edit
1
3
mit
ed10111f92b1f75d852647fe55e260974fab5eb4
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
apps/approval/api/serializers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport argparse\n\nfrom app import app\n\nparser = argparse.ArgumentParser()\nparser.add_argument('-d', '--debug', action='store_true', dest='debug', default=False)\nparser.add_argument('-p', '--port', action='store', dest='port', default=5...
python
edit
1
0
mit
7c05eb09dc5ff83ef45f3f84b9603ec6e43f58c7
njbbaer/unicorn-remote,njbbaer/unicorn-remote,njbbaer/unicorn-remote
run.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom random import choice\n\nclass RPSGame:\n shapes = ['rock', 'paper', 'scissors']\n draws = [('rock', 'rock'), ('paper', 'paper'), ('scissors', 'scissors')]\n first_wins = [('rock', 'scissors'), ('scissors', 'paper'), ('paper', ...
python
edit
1
3
mit
c2da36340d372deb3ebfc16f395bb32a60a9da12
kubkon/ee106-additional-material
rps.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport tempfile\nimport numpy as np\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg\nfrom metpy.plots.skewt import * # noqa\n\n\n# TODO: Need at some point to do image-based comparison, bu...
python
edit
2
1
bsd-3-clause
01949a1f5d8278ab1d577e2d56b1c9fd2f79724c
dopplershift/MetPy,ahaberlie/MetPy,Unidata/MetPy,ShawnMurd/MetPy,Unidata/MetPy,jrleeman/MetPy,ahaberlie/MetPy,ahill818/MetPy,deeplycloudy/MetPy,jrleeman/MetPy,dopplershift/MetPy
metpy/plots/tests/test_skewt.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport argparse\nimport sys\nimport logging\n\nimport emission.core.get_database as edb\nimport emission.net.ext_service.habitica.proxy as proxy\n\ndef reset_user(reset_em_uuid):\n del_result = proxy.habiticaProxy(reset_em_uuid, \"POST\"...
python
edit
3
1
bsd-3-clause
367be3298ac72f6d3e369a592e7a3f1d37b042e1
shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server
bin/ext_service/reset_all_habitica_users.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nargh\n\"\"\"\n\nimport tempfile\nimport os\nfrom subprocess import call\n\nEDITOR = os.environ.get('EDITOR', 'vim')\n\nif EDITOR in ['vim', 'nvim']:\n EXTRA_EDITOR_COMMAND = '+set backupcopy=yes'\nelse:\n EXTRA_EDITOR_COMMAND ...
python
edit
1
2
mit
fe3db3aca1d6166c3c3d739971346205591d8d9e
abaldwin88/roamer
roamer/python_edit.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nclass Stack(object):\n def __init__(self, stack=None):\n self.stack = stack if stack else []\n\n def push_frame(self, function_name, *args):\n self.stack.append(Frame(function_name, *args))\n\n def remove(self, item):...
python
edit
1
2
mit
f3f7cc59cfc79420a2f1fa00e3e8631250f4e9cf
mhmurray/cloaca,mhmurray/cloaca,mhmurray/cloaca,mhmurray/cloaca
cloaca/stack.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nswitch_failure_rate = 0.0\nswitch_recovery_rate = 0.0\ndataplane_drop_rate = 0.3\ncontrolplane_block_rate = 0.0\ncontrolplane_unblock_rate = 1.0\nofp_message_receipt_rate = 1.0\nofp_message_send_rate = 1.0\nofp_cmd_passthrough_rate = 0.0\nl...
python
edit
1
0
apache-2.0
5a67bff672e0a74419cadbdcaf9f6bd7b9336499
jmiserez/sts,ucb-sts/sts,jmiserez/sts,ucb-sts/sts
config/fuzzer_params.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# @file Contains Duplicate\n# @brief Given array of integers, find if array contains duplicates\n\n# https://leetcode.com/problems/contains-duplicate/\n\n'''\nGiven an array of integers, find if the array contains any duplicates.\nYour fun...
python
edit
1
4
mit
858a68a66e40ecc5d1a592503166e7096544b8c3
ngovindaraj/Python
leetcode/ds_hash_contains_duplicate.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/python\nimport os\n\nhostnames = eval(os.environ['hostnames'])\naddresses = eval(os.environ['addresses'])\n\ndef write_hosts(hostnames, addresses, file):\n f.write('DO NOT EDIT! THIS FILE IS MANAGED VIA HEAT\\n\\n')\n f.write('...
python
edit
1
2
mit
a9da17d7edb443bbdee7406875717d30dc4e4bf5
evoila/heat-common,evoila/heat-common
src/scripts/write_hosts.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"\nThis file serves as a hook into virtualenvs that do NOT have sitetools\ninstalled.\n\nIt is added to the $PYTHONPATH by the `dev` command so that new virtualenvs\ncan refer to the sitetools from the old virtualenv.\n\nIt tries to pl...
python
edit
3
0
bsd-3-clause
a2d90e92a0686578cc354b5979af1945233f03f6
mikeboers/sitetools,westernx/sitetools,westernx/sitetools
sitetools/venv_hook/sitecustomize.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom cgen import *\nfrom codeprinter import ccode\nimport ctypes\n\n\nclass Ternary(Generable):\n def __init__(self, condition, true_statement, false_statement):\n self.condition = ccode(condition)\n self.true_statement = c...
python
edit
2
1
mit
c3f5212dbb7452db48420d717c1815ad4e536c40
opesci/devito,opesci/devito
cgen_wrapper.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# encoding: utf-8\n\n\n\"\"\"\n.. codeauthor:: Tsuyoshi Hombashi <<EMAIL>>\n\"\"\"\n\nfrom __future__ import unicode_literals\n\nfrom ipaddress import ip_address\nimport itertools\n\nimport pytest\nimport six\nfrom typepy import (\n Type...
python
edit
1
1
mit
d20f04d65437138559445bf557be52a87690c7f2
thombashi/typepy
test/checker/test_checker_ipaddress.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom functools import partial\n\n\ndef response(callback, method, url, body, status=200):\n from stubilous.config import Route\n callback(Route(method=method, path=url, body=body, status=status, desc=\"\"))\n\n\nclass Builder(object):...
python
edit
1
1
mit
3e374aa6714b677bd9d9225b155adc5b1ffd680d
CodersOfTheNight/stubilous
stubilous/builder.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom openerp import models, fields\n\n\nclass Course(models.Model):\n _name = 'openacademy.course'\n\n name = fields.Char(string='Title', required=True)\n description = fields.Text(string='Description')\n responsible_id = fields...
python
edit
1
3
apache-2.0
5a3ed191cb29d328976b33a3bc4a2fa68b0be2e4
arogel/openacademy-project
openacademy/model/openacademy_course.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Import third party libs\nimport urwid\n\n# Import sconsole libs\nimport sconsole.cmdbar\nimport sconsole.static\nimport sconsole.jidtree\n\nFOOTER = [\n ('title', 'Salt Console'), ' ',\n ('key', 'UP'), ' ',\n ('key'...
python
edit
1
2
apache-2.0
51aca89cfcac99ffb0fa9304e55fad34a911bdc9
saltstack/salt-console
sconsole/manager.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.test import TestCase\nfrom django.urls import resolve\n\n\nclass HomePageTest(TestCase):\n fixtures = ['tests/functional/auth_dump.json']\n\n def test_root_url_resolves_to_index_page_view(self):\n found = resolve(\"...
python
edit
1
1
mit
765dd18fb05c0cef21b9dce7cbddda3c079f0b7d
sundeep-co-in/makegoalsdaily,sundeep-co-in/makegoalsdaily,sundeep-co-in/makegoalsdaily,sundeep-co-in/makegoalsdaily
logtoday/tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Utilities for general operations.\"\"\"\n\n\ndef IsNumeric(num_str):\n try:\n val = int(num_str)\n except ValueError:\n return False\n else:\n return True\n\ndef GuaranteeUnicode(obj):\n if type(obj) =...
python
edit
6
12
mit
ec30ac35feb0708414cfa70e8c42425fa25f74c2
lnishan/SQLGitHub
components/utilities.py
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom flask import Flask, render_template, jsonify\n\n\napp = Flask(__name__)\n\n# Read in the entire wordlist at startup and keep it in memory.\n# Optimization for improving search response time.\nwith open('typesetter/data/words.txt') as f...
python
edit
1
3
mit
7c9b93106d741568e64917ddb4c989a9fecdea17
rlucioni/typesetter,rlucioni/typesetter,rlucioni/typesetter
typesetter/typesetter.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nimport click\nimport json\nimport sys\n\nfrom gblinks import Gblinks\n\ndef check_broken_links(gblinks):\n broken_links = gblinks.check_broken_links()\n\n if broken_links:\n print_links(broken_links)\...
python
edit
4
4
mit
f61ba51f92ff47716128bb9d607b4cb46e7bfa4b
davidmogar/gblinks
gblinks/cli.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\n__version__ = '0.2.3'\n\n# This list defines all the modules that will be loaded if a user invokes\n# from climLab import *\n\n# totally out of date!\n\n#__all__ = [\"constants\", \"thermo\", \"orbital_table\",\n# \"long_orbita...
python
edit
22
0
mit
8cc66b50f3b4b7708ccf46e263cffba8e69dc1a2
cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab,brian-rose/climlab
climlab/__init__.py
rejected_lint
Too many lint violations: 22
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport StringIO\nimport unittest\n\nfrom testdoc.formatter import WikiFormatter\n\n\nclass WikiFormatterTest(unittest.TestCase):\n def setUp(self):\n self.stream = StringIO.StringIO()\n self.formatter = WikiFormatter(self.s...
python
edit
1
1
mit
c24f497bb3595e3034a8c641a88527092e27c450
testing-cabal/testdoc
testdoc/tests/test_formatter.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom changes.testutils import APITestCase\n\n\nclass PlanIndexTest(APITestCase):\n def test_simple(self):\n project1 = self.create_project()\n project2 = self.create_project()\n\n plan1 = self.create_plan(label='Foo'...
python
edit
1
1
apache-2.0
9728d59217e2fd8bcaaf7586a9a3b99c61764630
dropbox/changes,wfxiang08/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes,bowlofstew/changes
tests/changes/api/test_plan_details.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport unittest\nimport cbs\n\n\nclass MySettings(cbs.GlobalSettings):\n PROJECT_NAME = 'tests'\n\n @property\n def TEMPLATE_LOADERS(self):\n return super(MySettings, self).TEMPLATE_LOADERS + ('test',)\n\n\nclass GlobalSet...
python
edit
null
null
bsd-2-clause
8c5dba68915bb1cdba3c56eff15fdf67c5feed00
funkybob/django-classy-settings
tests/test_global.py
rejected_syntax
Syntax error detected by tree-sitter
false
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\nimport http.client\nimport time\n\nclass TestStringMethods(unittest.TestCase):\n\n def test_404NoConfig(self):\n connRouter = http.client.HTTPConnection(\"localhost\", 8666)\n connConfig = http.client.HTTPC...
python
edit
5
1
apache-2.0
2510e85a0b09c3b8a8909d74a25b444072c740a8
dhiaayachi/dynx,dhiaayachi/dynx
test/test_integration.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\nimport contextlib\nimport socket\nimport ssl\n\nimport pytest\n\ntry:\n from urllib3.contrib.securetransport import (\n WrappedSocket, inject_into_urllib3, extract_from_urllib3\n )\nexcept ImportError a...
python
edit
2
2
mit
a1acbcfc41a3f55e58e0f240eedcdf6568de4850
urllib3/urllib3,urllib3/urllib3,sigmavirus24/urllib3,sigmavirus24/urllib3
test/contrib/test_securetransport.py
rejected_duplicate
Near-duplicate of sample 83
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport multiprocessing as mp\n\n\nclass UI:\n\n def __init__(self, game):\n parent_conn, child_conn = mp.Pipe(duplex=False)\n self.ui_event_pipe = parent_conn\n self.game = game\n\n def get_move(self):\n ra...
python
edit
1
1
mit
e2234d41831d513b4da17d1031e2856785d23089
ethanal/othello,ethanal/othello
ui/__init__.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.conf.urls import url\nfrom django.contrib import admin\nfrom django.http import HttpResponse\n\n\nurlpatterns = [\n url(r'^$', lambda request, *args, **kwargs: HttpResponse()),\n url(r'^admin/', admin.site.urls),\n]\n\n```...
python
edit
1
0
bsd-3-clause
045192dd0a69dfe581075e76bbb7ca4676d321b8
ecometrica/django-vinaigrette
test_project/urls.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom regparser.tree.depth import markers as mtypes, optional_rules\nfrom regparser.tree.struct import Node\nfrom regparser.tree.xml_parser import (\n paragraph_processor, simple_hierarchy_processor)\n\n\nclass IgnoreNotesHeader(paragraph...
python
edit
1
3
cc0-1.0
c30347f34967ee7634676e0e4e27164910f9e52b
eregs/regulations-parser,tadhg-ohiggins/regulations-parser,tadhg-ohiggins/regulations-parser,cmc333333/regulations-parser,cmc333333/regulations-parser,eregs/regulations-parser
regparser/tree/xml_parser/note_processor.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Code for manipulating expressions in matrix form\n\n .. module:: matrix_form.py\n :synopsis:Code for manipulating expressions in matrix form\n .. moduleauthor:: Jonathan Gross <<EMAIL>>\n\n\"\"\"\n\nimport numpy as np\n\nd...
python
edit
1
2
mit
592be8dc73b4da45c948eac133ceb018c60c3be7
CQuIC/pysme
src/pysme/matrix_form.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"These JSON-formatted views require authentication.\"\"\"\n\nfrom flask import Blueprint, jsonify, request, current_app, g\nfrom werkzeug.exceptions import NotFound\nfrom os.path import join\nfrom ..dl import d...
python
edit
1
3
mit
e159465d4495ed2ebcbd1515d82f4f85fc28c8f7
nickfrostatx/corral,nickfrostatx/corral,nickfrostatx/corral
corral/views/private.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Theses functions read the legacy DISCUS stru file format in ASE Atoms.\"\"\"\n\nfrom __future__ import absolute_import\nfrom ase.atoms import Atoms\nfrom javelin.utils import unit_cell_to_vectors\n\n\ndef read_stru(filename):\n f =...
python
edit
1
7
mit
605202c7be63f2676b24b5f2202bfa0aa09c9e08
rosswhitfield/javelin
javelin/ase.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport foauth.providers\n\n\nclass MySpace(foauth.providers.OAuth1):\n # General info about the provider\n provider_url = 'http://www.myspace.com/'\n docs_url = 'http://developerwiki.myspace.com/index.php?title=RESTful_API_Overview...
python
edit
1
0
bsd-3-clause
503d3efd882466be4c846f74bd8eac9b90807dc2
foauth/foauth.org,foauth/foauth.org,foauth/foauth.org
services/myspace.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport numpy as np\nimport glfw\n\ndef step_env(env, max_path_length=100, iterations=1):\n \"\"\"Step env helper.\"\"\"\n for _ in range(iterations):\n env.reset()\n for _ in range(max_path_length):\n _, _, do...
python
edit
3
4
mit
49d67984d318d64528244ff525062210f94bd033
rlworkgroup/metaworld,rlworkgroup/metaworld
tests/helpers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2014, Matt Layman\n\nimport tempfile\nimport unittest\n\nfrom tap import TAPTestRunner\nfrom tap.runner import TAPTestResult\n\n\nclass TestTAPTestRunner(unittest.TestCase):\n\n def test_has_tap_test_result(self):\n ...
python
edit
1
1
bsd-2-clause
5fe4351ea52c8cb11af1cb61d65cb5f765638fd1
blakev/tappy,python-tap/tappy,Mark-E-Hamilton/tappy,mblayman/tappy
tap/tests/test_runner.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# fmt: off\n__title__ = \"spacy\"\n__version__ = \"3.0.0.dev14\"\n__release__ = True\n__download_url__ = \"https://github.com/explosion/spacy-models/releases/download\"\n__compatibility__ = \"https://raw.githubusercontent.com/explosion/spac...
python
edit
1
0
mit
8fb574900a6680f8342487e32979829efa33a11a
explosion/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy
spacy/about.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\n\n\"\"\"\n<Program Name>\n aggregate_tests.py\n\n<Author>\n Konstantin Andrianov.\n Zane Fisher.\n\n<Started>\n January 26, 2013.\n\n August 2013.\n Modified previous behavior that explicitly imported individual...
python
edit
1
3
mit
ec96669641c9b753c3ce74ce432213a17b0403fe
secure-systems-lab/securesystemslib,secure-systems-lab/securesystemslib
tests/aggregate_tests.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.http import Http404\nfrom django.core.exceptions import PermissionDenied\nfrom django.views.generic import DetailView, TemplateView, UpdateView\n\nfrom wafer.pages.models import Page\nfrom wafer.pages.forms import PageForm\n\n\n...
python
edit
1
8
isc
593d152bd6eec64bc8ee504020ba0e5e2345966c
CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer
wafer/pages/views.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport unittest\n\nimport MockMockMock\n\nfrom InteractiveCommandLine import *\n\nclass CommandLineCommandExecution( unittest.TestCase ):\n def setUp( self ):\n self.command = Command()\n self.optionHandler = MockMockMock.M...
python
edit
5
1
mit
3e12e61144fe4cd08f755130dde23066879521d1
jacquev6/InteractiveCommandLine
InteractiveCommandLine.UnitTest.py
rejected_lint
Too many lint violations: 5
true
[ { "role": "user", "content": "Here is the current file:\n```python\ndef application(env, start_response):\n start_response('200 OK', [('Content-Type', 'text/html')])\n return [b\"Hello World from a default Nginx uWSGI Python 3.6 app in a\\\n Docker container (default)\"]\n\n```\n\nApply thi...
python
edit
1
1
apache-2.0
becd5721e9d6dcd1eb762b9b9e7089e7a90fcdf9
tiangolo/uwsgi-nginx-docker,tiangolo/uwsgi-nginx-docker
python3.7-alpine3.7/app/main.py
rejected_duplicate
Near-duplicate of sample 1774
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom sqlalchemy import Column, Integer, String, func\nfrom app import db\n\nclass CnesProfessional(db.Model):\n __tablename__ = 'cnes_professional'\n year = Column(Integer, primary_key=True)\n region = Column(String...
python
edit
1
1
mit
22f94c5bb08ee6ae816109bdc06eab9e1974884a
daniel1409/dataviva-api,DataViva/dataviva-api
app/models/cnes_professional.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\nfrom typing import Union, Optional, Tuple\nfrom pathlib import Path\nfrom abc import ABC, abstractmethod\n\nfrom sklearn_porter.enums import Method, Language, Template\n\n\nclass EstimatorApiABC(ABC):\n \"\"\"\...
python
edit
1
1
bsd-3-clause
763077f355386b8a5fdb4bda44f5d2856563f674
nok/sklearn-porter
sklearn_porter/estimator/EstimatorApiABC.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\"\"\"Configuration.\"\"\"\n\nimport logging\nimport os\nimport re\n\nfrom google.appengine.ext.appstats import recording\n\nlogging.info('Loading %s from %s', __name__, __file__)\n\n# Custom webapp middleware to add Appstats.\ndef webapp_a...
python
edit
1
8
apache-2.0
66e0e8e2cb202ca3f4832bf728bfd53c084d6f62
rietveld-codereview/rietveld,openlabs/cr.openlabs.co.in,salomon1184/rietveld,foolonhill/rietveld,andyzsf/rietveld,arg0/rietveld,google-code-export/rietveld,berkus/rietveld,aungzanbaw/rietveld,v3ss0n/rietveld,DeanHere/rietveld,draem0507/rietveld,rietveld-codereview/rietveld,andyzsf/rietveld,dushmis/rietveld,robfig/rietv...
appengine_config.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# -*- coding: utf-8 -*-\n\"\"\"A small module for computing the smoothing length of a Gadget/Arepo simulation.\"\"\"\n\nimport numpy as np\n\ndef get_smooth_length(bar):\n \"\"\"Figures out if the particles are from AREPO or GADGET\n ...
python
edit
1
3
mit
dec3aaaefe2afdf4d3ce19dc808257ea49cc2b00
sbird/fake_spectra,sbird/fake_spectra,sbird/fake_spectra
hsml.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom txpostgres import txpostgres\n\nfrom twisted.internet import reactor\nfrom twisted.python import log, util\n\n# connect to the database\nconn = txpostgres.Connection()\nd = conn.connect('dbname=postgres')\n\n# define a callable that wi...
python
edit
1
1
mit
14cd040eb2be66bbdc62b788a4e3da1ef1297458
wulczer/txpostgres
doc/transaction_example.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n#!/usr/bin/env python\nimport unittest\nimport pep438\n\n\nif __name__ == '__main__':\n unittest.main()\n\n```\n\nApply this change: Add a basic command line test" }, { "role": "assistant", "content": "#!/usr/bin/env python\n...
python
edit
1
2
mit
ff28ca5797c4468dbe58d78d55b5df6b8878ac36
treyhunner/pep438
test_pep438.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom __future__ import print_function, division, absolute_import\n\nfrom numba import types, typing\n\n\ndef is_signature(sig):\n return isinstance(sig, (str, tuple))\n\n\ndef normalize_signature(sig):\n if isinstance(sig, str):\n ...
python
edit
1
4
bsd-2-clause
dcfb5116ba5f068afa354d063a4ab33bce853715
pitrou/numba,GaZ3ll3/numba,pitrou/numba,gdementen/numba,ssarangi/numba,gmarkall/numba,stonebig/numba,stonebig/numba,seibert/numba,GaZ3ll3/numba,gmarkall/numba,stonebig/numba,IntelLabs/numba,seibert/numba,pombredanne/numba,numba/numba,seibert/numba,jriehl/numba,pitrou/numba,numba/numba,stefanseefeld/numba,IntelLabs/numb...
numba/sigutils.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport subprocess\n\nimport pytest\n\n\ndef test_list_subcommands_has_all_scripts():\n \"\"\"Tests if the output from running `fontbakery --list-subcommands` matches\n the fontbakery scripts within the bin folder.\"\"\"\n ...
python
edit
1
4
apache-2.0
b35e8fa3cde243aa444aa056d60f7a37b61e825b
googlefonts/fontbakery,googlefonts/fontbakery,graphicore/fontbakery,graphicore/fontbakery,moyogo/fontbakery,graphicore/fontbakery,moyogo/fontbakery,moyogo/fontbakery,googlefonts/fontbakery
tests/commands/test_usage.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\nimport logging\nfrom typing import Any, Dict\n\nfrom django.apps import AppConfig\nfrom django.conf import settings\nfrom django.core.cache import cache\nfrom django.db.models.signals import post_migrate\n\ndef flush_cache(sender: AppConf...
python
edit
4
2
apache-2.0
f34a5d682832749dbf0011d162bf4c7c18892b45
timabbott/zulip,tommyip/zulip,zulip/zulip,andersk/zulip,andersk/zulip,eeshangarg/zulip,kou/zulip,eeshangarg/zulip,eeshangarg/zulip,showell/zulip,brainwane/zulip,andersk/zulip,rishig/zulip,synicalsyntax/zulip,andersk/zulip,tommyip/zulip,hackerkid/zulip,kou/zulip,zulip/zulip,showell/zulip,eeshangarg/zulip,shubhamdhama/zu...
zerver/apps.py
rejected_lint
Too many lint violations: 4
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework import serializers\n\nfrom .models import PRDeployment\n\n\nclass PRDeploymentSerializer(serializers.ModelSerializer):\n\n class Meta:\n model = PRDeployment\n fields = (\n 'id',\n ...
python
edit
1
0
mit
a026e6c82cb6391fe7f04c85fb1c09f89fefc7de
frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq
frigg/deployments/serializers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom pluginsystem import object_feature_computation_plugin\nimport vigra\nfrom vigra import numpy as np\n\nclass StandardObjectFeatures(object_feature_computation_plugin.ObjectFeatureComputationPlugin):\n \"\"\"\n Computes the standar...
python
edit
3
1
mit
eab72cdb7e58b5398ace19c74569b1eb35ea91f8
chaubold/hytra,chaubold/hytra,chaubold/hytra
toolbox/plugins/standard_object_features.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n''' Representation of an element\n@param element_type: type of the element\n@param length: length of the element\n'''\nimport pkg_resources\nfrom rml.exceptions import ConfigException\npkg_resources.require('cothread')\nfrom cothread.catool...
python
edit
1
3
apache-2.0
55e506489e93bad1d000acd747a272103e789a59
willrogers/pml,razvanvasile/RML,willrogers/pml
rml/element.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 _\n\nfrom mezzanine.core.models import Displayable, RichText\n\nclass RepeatType(models.Model):\n DAILY = 'daily'\n WEEKLY = 'weekly',\n MONTHLY = ...
python
edit
3
0
mit
ab78faab8e3536c49f829ccbd71540a93485a7cb
jonge-democraten/website,jonge-democraten/website,jonge-democraten/website,jonge-democraten/website
website/jdevents/models.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.8a0'\n\n```\n\nApply this change: Increment minor version to 0.8" }, { "role": "assistant", "content": "\"\"\"yolk.\n\nAut...
python
edit
1
0
bsd-3-clause
a28f4b6562527ac09f765ff72e034b6122b2fa8b
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#!/usr/bin/env python\n\n# ----------------------------------------------------------------------------------------------\n# Created by: Lee & Matt\n#\n# Description: Contains unit test for BioID Class\n# -----------------------------------...
python
edit
1
3
mit
fb71c13e0995957f1879d8e8ce047f347777564e
LeeBergstrand/BioMagick,LeeBergstrand/BioMagick
testing/test_BioMagick.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport pysony\nimport fnmatch\n\ncamera = pysony.SonyAPI()\n#camera = pysony.SonyAPI(QX_ADDR='http://192.168.122.1:8080/')\n\nmode = camera.getAvailableApiList()\n\nprint \"Available calls:\"\nfor x in (mode[\"result\"]):\n for y in x:\n...
python
edit
8
0
mit
0b8075e8eb8fb52a9407bfa92d61e5a5363f8861
Bloodevil/sony_camera_api,mungewell/sony_camera_api,Bloodevil/sony_camera_api
src/example/dump_camera_capabilities.py
rejected_lint
Too many lint violations: 8
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport types\nfrom unittest import TestCase\n\nfrom yoconfigurator.base import read_config\nfrom yoconfig import configure_services\n\nfrom pycloudflare.services import CloudFlareService\n\napp_dir = os.path.abspath(os.path.join(...
python
edit
3
1
mit
3c3ceddf3c7d92e6e66017c0980102421e9bbe43
yola/pycloudflare,gnowxilef/pycloudflare
tests/test_integration.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport platform\n\n_IS_PYTHON_3 = (platform.version() >= '3')\n\nidentity = lambda x : x\n\n# u('string') replaces the forwards-incompatible u'string'\nif _IS_PYTHON_3:\n u = identity\nelse:\n import codecs\n def u(string):\n ...
python
edit
1
1
apache-2.0
9be04ea1030b423b7414dbd386ae2db2f4761f07
mbrukman/cloud-launcher,mbrukman/cloud-launcher,mbrukman/cloud-launcher,mbrukman/cloud-launcher
third_party/bunch/bunch/python3_compat.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom rest_framework import serializers as ser\n\nfrom api.base.serializers import JSONAPISerializer\n\n\nclass PreprintProviderSerializer(JSONAPISerializer):\n\n filterable_fields = frozenset([\n 'name',\n 'description',\n ...
python
edit
1
1
apache-2.0
e8030cfb3daee6b7e467f50a215fbffc5ef90223
CenterForOpenScience/osf.io,icereval/osf.io,laurenrevere/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,binoculars/osf.io,acshi/osf.io,chrisseto/osf.io,adlius/osf.io,cwisecarver/osf.io,cslzchen/osf.io,erinspace/osf.io,mluo613/osf.io,mluo613/osf.io,mluo613/osf.io,caseyrollins/osf.io,rdhyee/osf.io,aaxelb/osf.io,monikagrabo...
api/preprint_providers/serializers.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport numpy as np\nimport pandas as pd\nimport zipfile\n\nfrom bom_data_parser import mapper\n\ndef read_climate_data_online_csv(fname):\n df = pd.read_csv(fname, parse_dates={'Date': [2,3,4]})\n\n column_names = []\n f...
python
edit
1
3
bsd-3-clause
dbb15e4919c5d54d2e755cea700cc287bf164ad4
amacd31/bom_data_parser,amacd31/bom_data_parser
bom_data_parser/climate_data_online.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\n\ntry:\n import scipy.linalg.cython_blas\n has_blas = True\nexcept ImportError:\n has_blas = False\n\nimport numba.unittest_support as unittest\n\n\n# The \"@\" operator only compiles on Python 3.5+.\nhas_matmul = sys.v...
python
edit
2
2
bsd-2-clause
dd171296a980dcc0349cf54b2afd6d2399cfb981
numba/numba,cpcloud/numba,stuartarchibald/numba,numba/numba,stefanseefeld/numba,gmarkall/numba,sklam/numba,stefanseefeld/numba,stefanseefeld/numba,jriehl/numba,IntelLabs/numba,seibert/numba,IntelLabs/numba,seibert/numba,stuartarchibald/numba,stonebig/numba,cpcloud/numba,sklam/numba,cpcloud/numba,stefanseefeld/numba,skl...
numba/tests/matmul_usecase.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom chatty import create\nimport config\n\nfrom tornado.ioloop import PeriodicCallback, IOLoop\nfrom functools import partial\n\n\nif __name__ == \"__main__\":\n chat = create(config)\n\n# Tell chat to authenticate with the beam server....
python
edit
1
1
mit
87e5d0e5e92ed5f94e4238e73453934abc7835dd
WatchBeam/developers,WatchBeam/developers,WatchBeam/developers,WatchBeam/developers,WatchBeam/developers
src/tutorials/code/python/chat/5.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# This Python file uses the following encoding: utf-8\ndef main():\n try:\n fileName = \"MengZi_Traditional.md\"\n filePath = \"../../source/\" + fileName\n content = None\n with open(filePath,'r') as file:\n ...
python
edit
2
2
mit
f50f892e2ad2108342f53406ea86f65f89eeaafb
fan-jiang/Dujing
PythonScript/Helper/Helper.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom freeposte import manager, db\nfrom freeposte.admin import models\n\n\n@manager.command\ndef flushdb():\n \"\"\" Flush the database\n \"\"\"\n db.drop_all()\n\n\n@manager.command\ndef initdb():\n \"\"\" Initialize the databa...
python
edit
1
1
mit
2095b3f18926a9ab08faeae634f4f4653e4b7590
kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io,kaiyou/freeposte.io
admin/manage.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport sys\nimport os\nimport uuid\nfrom time import sleep\n\nif len(sys.argv) != 3:\n print \"Wrong number of args\"\n exit(1)\n \nworkflow_name = sys.argv[1]\nnum_runs = int(sys.argv[2])\n\nfor this_run in range(num_runs):\n \...
python
edit
2
0
mit
b6e40edee998170fafe92096447a0f54e9adb86f
llevar/germline-regenotyper,llevar/germline-regenotyper
tracker/src/main/scripts/launch-workflow.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nimport os\nimport subprocess\nfrom requests import get, delete\n\n\ndef test_pre_authentication_hook(env):\n os.environ.update({\n 'DO_API_KEY': env.key,\n 'DO_DOMAIN': env.domain,\n 'CERTBOT_DOMAIN': '%s.%s' % (env....
python
edit
1
3
apache-2.0
d3cc8fdbad2ca6888e33b119faae68d691ab291e
Jitsusama/lets-do-dns
tests/system/test_lets-do-dns_script.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n\n\"\"\"\nAlternative interact function that creates a single static figure that can\nbe viewed online, e.g. on Github or nbviewer, or for use with nbconvert.\n\"\"\"\n\nfrom __future__ import print_function\n\nprint(\"Will create static fi...
python
edit
1
5
bsd-3-clause
4e62f8292802aade03637dbbd05be56b9fad7d61
maojrs/riemann_book,maojrs/riemann_book,maojrs/riemann_book
utils/snapshot_widgets.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\n# Copyright (c) 2011 gocept gmbh & co. kg\n# See also LICENSE.txt\n\nimport mock\nimport zeit.cms.tagging.tag\n\n\nclass TaggingHelper(object):\n \"\"\"Mixin for tests which need some tagging infrastrucutre.\"\"\"\n\n def get_tag(self...
python
edit
1
2
bsd-3-clause
a34a34c1bf897b5681e7a421ea53ca5e9d065ab8
ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms,ZeitOnline/zeit.cms
src/zeit/cms/tagging/testing.py
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```python\nfrom django.apps import AppConfig\n\n\nclass AddressConfig(AppConfig):\n \"\"\"\n Define config for the member app so that we can hook in signals.\n \"\"\"\n\n name = \"address\"\n\n```\n\nApply this change: :bug: Set default ID...
python
edit
1
0
bsd-3-clause
6e5b13859b8a795b08189dde7ce1aab4cca18827
furious-luke/django-address,furious-luke/django-address,furious-luke/django-address
address/apps.py
accepted
null
true