input stringlengths 0 929 | output stringlengths 0 10.3k | task stringclasses 3 values | index int64 0 5.38k | liscence stringclasses 4 values | source stringclasses 15 values | instruction stringlengths 13 3.45k |
|---|---|---|---|---|---|---|
class ReportCreateForm ( SimpleModelForm ) :
note = forms . CharField ( widget = forms . Textarea )
captcha = ReCaptchaField ( attrs = { "str" : "str" } )
class Meta :
model = Report
fields = ( )
def __init__ ( self , ** kwargs ) :
caption = _ ( "str" )
super ( ReportCreateForm , self ) . __init__ ( caption , ** kwargs )
| このpythonコードに誤りはありません。 | code_fix | 4,000 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run ( self ) :
self . dlg . setup ( )
self . dlg . exec_ ( )
| このpythonコードに誤りはありません。 | code_fix | 4,001 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import datetime
from south . db import db
from south . v2 import SchemaMigration
from django . db import models
"str"
| このpythonコードに誤りはありません。 | code_fix | 4,002 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MsgPackTestService ( Fruit ) :
marshaller = marshalling . MsgPackMarshaller ( )
multiply = MultiplyExecutable ( )
| このpythonコードに誤りはありません。 | code_fix | 4,003 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import socket
import sys
import subprocess
import os . path
PATH = "str"
if len ( sys . argv ) != 2 :
print ( "str" )
sys . exit ( 0 )
| このpythonコードに誤りはありません。 | code_fix | 4,004 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def command_handler ( settings ) :
"str"
parser = argparse . ArgumentParser ( description = "str" )
parser . add_argument ( "str" , help = "str" )
args = parser . parse_args ( )
if "str" in args :
setup_environ ( settings )
from wsgifire . server . devserver import runserver
runserver ( )
else :
parser . print_help ( )
| このpythonコードに誤りはありません。 | code_fix | 4,005 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def send_password_request_link ( password_request , user ) :
current_request = CrequestMiddleware . get_request ( )
absolute_reset_password_url = current_request . build_absolute_uri (
reverse ( "str" , args = ( password_request . uuid , ) )
)
replacements = { "str" : user , "str" : absolute_reset_password_url }
txt_message = get_template ( "str" ) . render ( replacements )
html_message = get_template ( "str" ) . render ( replacements )
subject = "str"
return send_mail ( subject , txt_message , settings . EMAIL_HOST_USER , recipient_list = [ user . email ] ,
fail_silently = False , html_message = html_message )
| このpythonコードに誤りはありません。 | code_fix | 4,006 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run_test ( ) :
child = subprocess . Popen ( [ "str" ] )
child . wait ( )
| このpythonコードに誤りはありません。 | code_fix | 4,007 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , factory ) :
self . factory = factory
self . logger = logging . getLogger ( "str" )
self . turl ( )
| このpythonコードに誤りはありません。 | code_fix | 4,008 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_name ( self ) :
valid_email_list = [ "str" ,
"str" ,
"str" ,
"str" , "str" ,
"str" ]
invalid_email_list = [ "str" , "str" ,
"str" , "str" , "str" , "str" , "str" ,
"str" ]
for x in valid_email_list :
self . assertTrue ( frappe . utils . parse_addr ( x ) [ 0 ] )
for x in invalid_email_list :
self . assertFalse ( frappe . utils . parse_addr ( x ) [ 0 ] )
| このpythonコードに誤りはありません。 | code_fix | 4,009 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import cv
import time
cv . NamedWindow ( "str" , 1 )
capture = cv . CaptureFromCAM ( 0 )
while True :
img = cv . QueryFrame ( capture )
cv . ShowImage ( "str" , img )
if cv . WaitKey ( 10 ) == 27 :
break
| このpythonコードに誤りはありません。 | code_fix | 4,010 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class SimpleTestCase ( unittest . TestCase ) :
def test_index ( self ) :
tester = app . test_client ( self )
response = tester . get ( "str" , content_type = "str" )
self . assertEqual ( response . status_code , 200 )
def test_page_loads ( self ) :
tester = app . test_client ( self )
response = tester . get ( "str" , content_type = "str" )
self . assertIn ( "str" , response . data )
| このpythonコードに誤りはありません。 | code_fix | 4,011 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_media_url ( self , host , media_id ) :
web_url = self . get_url ( host , media_id )
html = self . net . http_GET ( web_url ) . content
r = "str"
sources = [ ]
regex = re . finditer ( r , html , re . DOTALL )
for s in regex :
sources . append ( urlresolver . HostedMediaFile ( url = s . group ( 1 ) ) )
source = urlresolver . choose_source ( sources )
return source . resolve ( )
| このpythonコードに誤りはありません。 | code_fix | 4,012 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Player ( object ) :
"str"
def __init__ ( self , name ) :
self . current_score = 0
self . name = name
| このpythonコードに誤りはありません。 | code_fix | 4,013 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DiasporaJetpackComponent ( firenado . core . TornadoComponent ) :
def get_handlers ( self ) :
return [
( "str" , diaspora_jetpack . handlers . IndexHandler ) ,
( "str" , diaspora_jetpack . handlers . SessionHandler ) ,
( "str" , tornado . web . StaticFileHandler ,
{ "str" : os . path . join ( self . get_component_path ( ) ,
"str" ) } ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,014 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import io
import tarfile
from betamax import Betamax
from requests import Session
from nose . tools import assert_equal , assert_true , assert_false , assert_in
from . import URL , APIKEY
from submitter . content_service import ContentService
| このpythonコードに誤りはありません。 | code_fix | 4,015 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import blinker
_signals = blinker . Namespace ( )
repository_created = _signals . signal ( "str" )
repository_updated = _signals . signal ( "str" )
repository_deleted = _signals . signal ( "str" )
tag_created = _signals . signal ( "str" )
tag_deleted = _signals . signal ( "str" )
before_put_image_json = _signals . signal ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,016 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import absolute_import , division , unicode_literals
import straight . threading
import time
| このpythonコードに誤りはありません。 | code_fix | 4,017 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , preferred_during_scheduling_ignored_during_execution = None , required_during_scheduling_ignored_during_execution = None ) :
"str"
self . _preferred_during_scheduling_ignored_during_execution = None
self . _required_during_scheduling_ignored_during_execution = None
self . discriminator = None
if preferred_during_scheduling_ignored_during_execution is not None :
self . preferred_during_scheduling_ignored_during_execution = preferred_during_scheduling_ignored_during_execution
if required_during_scheduling_ignored_during_execution is not None :
self . required_during_scheduling_ignored_during_execution = required_during_scheduling_ignored_during_execution
| このpythonコードに誤りはありません。 | code_fix | 4,018 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def GetWordWildcard ( self , word ) :
result = Set ( )
for item in list ( self . index . keys ( ) ) :
if word == item [ 0 : len ( word ) ] :
result = result . union ( self . index [ item ] )
return result
| このpythonコードに誤りはありません。 | code_fix | 4,019 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os
from bzrlib . branch import Branch
from bzrlib . tests import TestCaseWithTransport
| このpythonコードに誤りはありません。 | code_fix | 4,020 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def try_long_cast ( string ) :
"str"
try :
long ( string )
return True
except ValueError :
return False
| このpythonコードに誤りはありません。 | code_fix | 4,021 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_provision_attributes ( appliance , provider , small_template ) :
"str"
provision_data = get_provision_data (
appliance . rest_api , provider , small_template , auto_approve = False )
response = appliance . rest_api . collections . provision_requests . action . create ( ** provision_data )
assert appliance . rest_api . response . status_code == 200
provision_request = response [ 0 ]
provision_request . action . deny ( reason = "str" )
provision_request . reload ( attributes = ( "str" , "str" ) )
assert provision_request . v_workflow_class
assert provision_request . v_allowed_tags
| このpythonコードに誤りはありません。 | code_fix | 4,022 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class ReflectiveObjectDefinition ( ObjectDefinition ) :
def __init__ ( self , object_type , is_singleton ) :
pass
| このpythonコードに誤りはありません。 | code_fix | 4,023 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
DTC = "str"
DST = "str"
TMPDIR = "str"
TMPNAME = "str"
NUMFRAMES = 35
FRAMERATE = 10.0
CONVERT = "str"
CLOCKWISE = True
DSIZE = ( 16 , 16 )
im_src = Image . open ( DTC )
if CLOCKWISE :
im_src = im_src . transpose ( Image . FLIP_LEFT_RIGHT )
| このpythonコードに誤りはありません。 | code_fix | 4,024 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from gibbs . conditions import AqueousParams
from pathways . bounds import Bounds
from pathways . concs import ConcentrationConverter
from util . SBtab import SBtabTools
from os import path
RELPATH = path . dirname ( path . realpath ( __file__ ) )
COFACTORS_FNAME = path . join ( RELPATH , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,025 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DocumentBody ( Element ) :
def __init__ ( self ) :
self . element_type = ElementType . Body
self . _children = [ ]
self . _attributes = [ ]
def getHtml ( self ) :
html = "str"
for x in self . _children :
html += x . getHtml ( )
return "str" + html + "str"
| このpythonコードに誤りはありません。 | code_fix | 4,026 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def connection ( self ) :
"str"
if self . _cached_connection is None :
self . _cached_connection = boto . sqs . connect_to_region (
self . region ,
aws_access_key_id = self . access_key ,
aws_secret_access_key = self . secret_key ,
is_secure = self . is_secure ,
port = self . port
)
logger . debug ( "str" )
return self . _cached_connection
| このpythonコードに誤りはありません。 | code_fix | 4,027 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Controller :
"str"
def __init__ ( self , repository ) :
"str"
self . _repo = repository
def __str__ ( self ) :
"str"
return str ( self . _repo )
def getRepository ( self ) :
"str"
return self . _repo
def getList ( self ) :
"str"
return self . _repo . getElementList ( )
| このpythonコードに誤りはありません。 | code_fix | 4,028 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import datetime
import random
try :
import numpy as np
except ImportError :
pass
from operator import mul
| このpythonコードに誤りはありません。 | code_fix | 4,029 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_settings_list_raises_error_if_noncontrib_not_public ( self ) :
noncontrib = AuthUserFactory ( )
res = self . app . get (
self . setting_list_url ,
auth = noncontrib . auth ,
expect_errors = True )
assert_equal ( res . status_code , 403 )
| このpythonコードに誤りはありません。 | code_fix | 4,030 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class ShopConfig ( AppConfig ) :
name = "str"
verbose_name = "str"
| このpythonコードに誤りはありません。 | code_fix | 4,031 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def GetContent ( self ) :
if self . content is None :
self . _RetrieveContent ( )
return self . content
| このpythonコードに誤りはありません。 | code_fix | 4,032 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def post ( self , url ) :
helpers . debug ( __file__ , url = url )
username = self . get_argument ( "str" )
key = self . get_argument ( "str" )
if not self . _verify_api_key ( username , key ) :
self . set_status ( 403 )
self . write ( "str" )
return
self . set_secure_cookie ( "str" , "str" % ( username , key ) )
self . redirect ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,033 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CustomGoogleAnalytics ( GoogleAnalytics ) :
account = None
def __init__ ( self , account = None ) :
super ( ) . __init__ ( account )
@ property
def template ( self ) :
return "str"
@ property
def source ( self ) :
if self . account is None :
return None
return self . template % self . account
| このpythonコードに誤りはありません。 | code_fix | 4,034 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class LabeledMultiValueField ( LabeledField , MultiValueField ) :
"str"
pass
| このpythonコードに誤りはありません。 | code_fix | 4,035 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _parsejson ( x ) :
"str"
return json . loads ( x . read ( ) . decode ( "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,036 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class WaterQuality ( BaseModel ) :
site = Charfield ( )
sample_campaign = TextField ( )
lab_id = TextField ( )
sample_id = CharField ( )
sample_date = DateField ( )
param_name = TextField ( )
method_name = TextField ( )
analysis_result = DoubleField ( )
qualifier_flags = TextField ( )
detection_limit = FloatField ( )
reporting_limit = FloatField ( )
practical_quantitation_limit = NumericField ( )
measure_unit = TextField ( )
analysis_date = DateField ( )
sample_comments = TextField ( )
results_comments = TextField ( )
class Meta :
database = db
| このpythonコードに誤りはありません。 | code_fix | 4,037 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import agros2d as a2d
from test_suite . scenario import Agros2DTestCase
from test_suite . scenario import Agros2DTestResult
from math import sin , cos
| このpythonコードに誤りはありません。 | code_fix | 4,038 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from datetime import timedelta
try :
import bootstrap
except :
pass
import unittest
import time
import nwidget
| このpythonコードに誤りはありません。 | code_fix | 4,039 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Student :
_staticval = - 1
@ classmethod
def myclassmethod ( x ) :
print ( x . _staticval )
@ staticmethod
def mystaticmethod ( ) :
print ( Student . _staticval )
def my_method ( self ) :
print ( Student . _staticval )
| このpythonコードに誤りはありません。 | code_fix | 4,040 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def classify_tweet ( self , raw_tweet_text ) :
processed_tweet = self . clean_up_tweet ( raw_tweet_text )
word_features = self . word_feats ( processed_tweet )
return self . classifier . classify ( word_features )
| このpythonコードに誤りはありません。 | code_fix | 4,041 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import json
import os
import sys
import requests
import config
from src import *
from templates . text import TextTemplate
WIT_AI_ACCESS_TOKEN = os . environ . get ( "str" , config . WIT_AI_ACCESS_TOKEN )
| このpythonコードに誤りはありません。 | code_fix | 4,042 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from PyQt5 import QtCore , QtGui , QtWidgets
from PyQt5 . QtWidgets import QDateTimeEdit , QCheckBox , QVBoxLayout , QHBoxLayout , QFrame , QWidget , QLabel , QLineEdit , QTabWidget , QSpinBox , QPushButton , QDial , QComboBox , QFontComboBox , QSpacerItem , QSizePolicy
from PyQt5 . QtGui import QIcon
import ast
import os
from persepolis . scripts . newopen import Open
from persepolis . gui import icons_resource
home_address = os . path . expanduser ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,043 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import re
_BASE_OBJECT_REFERENCE_REGEX_STRING = (
"str" )
OBJECT_REFERENCE_REGEX_STRING = _BASE_OBJECT_REFERENCE_REGEX_STRING . format (
allowed_types = "str" )
OBJECT_REFERENCE_REGEX = re . compile ( OBJECT_REFERENCE_REGEX_STRING )
LINK_REFERENCE_REGEX = re . compile (
"str" +
"str" +
"str" +
OBJECT_REFERENCE_REGEX_STRING +
"str" )
| このpythonコードに誤りはありません。 | code_fix | 4,044 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def has_parameter ( self , name ) :
for param_name , param_value in self . _parameters :
if param_name == name :
return True
return False
| このpythonコードに誤りはありません。 | code_fix | 4,045 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def payment_product882_specific_input ( self ) :
"str"
return self . __payment_product882_specific_input
| このpythonコードに誤りはありません。 | code_fix | 4,046 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def execute ( ) :
import webnotes
webnotes . reload_doc ( "str" , "str" , "str" )
webnotes . reload_doc ( "str" , "str" , "str" )
for pi in webnotes . conn . sql ( "str" ) :
webnotes . get_obj ( "str" , pi [ 0 ] ,
with_children = 1 ) . update_qty ( change_modified = False )
webnotes . conn . commit ( )
| このpythonコードに誤りはありません。 | code_fix | 4,047 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def set_connection_timeout ( self , timeout ) :
"str"
self . _connection_timeout = timeout
| このpythonコードに誤りはありません。 | code_fix | 4,048 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . core . exceptions import ValidationError
from django . db import models
from django . db . models . signals import post_save
from django . dispatch import receiver
from django . utils . translation import ugettext as _
from django . core . urlresolvers import reverse
from django . contrib . auth . models import User , Permission
from taggit . managers import TaggableManager
from geonode . base . enumerations import COUNTRIES
from geonode . people . enumerations import ROLE_VALUES
| このpythonコードに誤りはありません。 | code_fix | 4,049 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup
__author__ = "str"
setup (
name = "str" ,
version = "str" ,
url = "str" ,
license = "str" ,
author = "str" ,
author_email = "str" ,
description = "str" ,
long_description = __doc__ ,
packages = [ "str" ] ,
include_package_data = True ,
zip_safe = False ,
platforms = "str" ,
install_requires = [ "str" ] ,
classifiers = [
"str" ,
"str" ,
"str" ,
"str" ,
"str"
] ,
)
| このpythonコードに誤りはありません。 | code_fix | 4,050 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def split_model_fields ( obj , fields ) :
"str"
model_fields = [ ]
other_fields = [ ]
for field in fields :
if hasattr ( obj , field ) :
model_fields . append ( field )
else :
other_fields . append ( field )
return model_fields , other_fields
| このpythonコードに誤りはありません。 | code_fix | 4,051 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def getAllRanges ( self , codes ) :
mranges = [ ]
for code in codes :
mranges . append ( code [ - 1 ] )
return mranges
| このpythonコードに誤りはありません。 | code_fix | 4,052 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
import time
today = time . strftime ( "str" )
if today == "str" :
print ( "str" )
else :
print ( "str" + today )
| このpythonコードに誤りはありません。 | code_fix | 4,053 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def visit_read_binding ( self , rb ) :
if not self . is_global ( rb . binding ) :
return
self . replace ( rb , I . make_getitem ( self . make_read_map ( ) ,
I . make_constant ( rb . binding . symbol ) ) )
| このpythonコードに誤りはありません。 | code_fix | 4,054 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from antlr4 import InputStream , CommonTokenStream , ParseTreeWalker
from antlr4 . tree . Trees import Trees
from . SQLiteLexer import SQLiteLexer
from . SQLiteParser import SQLiteParser
from . SQLiteListener import SQLiteListener
from . SQLiteVisitor import SQLiteVisitor
| このpythonコードに誤りはありません。 | code_fix | 4,055 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import absolute_import
import datetime
from collections import OrderedDict
import numpy as np
import matplotlib . pyplot as plt
from astropy . io import fits
import pandas
from sunpy . lightcurve import LightCurve
from sunpy . time import parse_time
from sunpy import config
from sunpy . extern . six . moves import urllib
TIME_FORMAT = config . get ( "str" , "str" )
__all__ = [ "str" ]
| このpythonコードに誤りはありません。 | code_fix | 4,056 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def id_for_label ( self , id_ ) :
"str"
if id_ :
id_ += "str"
return id_
| このpythonコードに誤りはありません。 | code_fix | 4,057 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class SoftwareAdmin ( admin . ModelAdmin ) :
fieldsets = (
( "str" , {
"str" : ( "str" , "str" ) } ) ,
( "str" , {
"str" : ( "str" , "str" ) } ) ,
)
search_fields = [ "str" ]
| このpythonコードに誤りはありません。 | code_fix | 4,058 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , vm_name , port = 8080 , vidDevName = None ) :
BaseVMHandler . __init__ ( self , vm_name , vidDevName )
threading . Thread . __init__ ( self )
self . port = port
self . app = tornado . web . Application ( [ ( "str" , WebVMHandler . WSHandler ,
dict ( display = self . display , mouse = self . mouse , keyboard = self . keyboard ) ) ] )
self . app . listen ( self . port )
| このpythonコードに誤りはありません。 | code_fix | 4,059 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def is_detach_process_context_required ( ) :
"str"
result = True
if is_process_started_by_init ( ) or is_process_started_by_superserver ( ) :
result = False
return result
| このpythonコードに誤りはありません。 | code_fix | 4,060 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from deposit_receipt import Deposit_Receipt
from server_errors import SWORD2ERRORSBYIRI , get_error
| このpythonコードに誤りはありません。 | code_fix | 4,061 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def serialize ( self , include_site = True , include_map = False ) :
ret = { }
ret [ "str" ] = self . name
ret [ "str" ] = self . id
ret [ "str" ] = self . text
ret [ "str" ] = self . url
ret [ "str" ] = app . utility . serialize_datetime ( self . creation_time )
if include_site :
ret [ "str" ] = self . site_id
if include_map :
ret [ "str" ] = self . mapping_id
return ret
| このpythonコードに誤りはありません。 | code_fix | 4,062 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def send_measure ( url , data , email , password ) :
"str"
headers = { "str" : "str" , "str" : "str" }
r = requests . post ( url , data = json . dumps ( data ) , headers = headers , auth = ( email , password ) )
if r . status_code == 200 :
print ( r . content )
else :
print ( r . status_code )
| このpythonコードに誤りはありません。 | code_fix | 4,063 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import unittest
import sys
import os
from cStringIO import StringIO
import aclgen
| このpythonコードに誤りはありません。 | code_fix | 4,064 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def first_sad ( stack ) :
for i in xrange ( 0 , len ( stack ) ) :
if not stack [ i ] :
return i
return i
| このpythonコードに誤りはありません。 | code_fix | 4,065 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_parse_date_from_datetime ( self ) :
"str"
bxl = pytz . timezone ( "str" )
dt_ = bxl . localize ( dt . datetime ( 2014 , 11 , 23 , 1 , 2 , 3 ) )
epoch = pytz . UTC . localize ( dt . datetime ( 1970 , 1 , 1 , 0 , 0 , 0 ) )
epoch_expected = ( dt_ - epoch ) . total_seconds ( )
pts = parse_date ( dt_ )
self . assertEqual ( pts . value / 1e9 , epoch_expected )
| このpythonコードに誤りはありません。 | code_fix | 4,066 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class IConfig ( Interface ) :
"str"
def update_config ( self , config ) :
"str"
| このpythonコードに誤りはありません。 | code_fix | 4,067 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def valueToString ( value ) :
if isinstance ( value , OrderedDict ) :
asList = [ "str" . format ( key , valueToString ( value [ key ] ) ) for key in sorted ( value . keys ( ) ) ]
return listAsString ( asList )
elif isinstance ( value , list ) :
return listAsString ( value )
elif isinstance ( value , set ) :
return listAsString ( list ( value ) )
else :
return str ( value )
| このpythonコードに誤りはありません。 | code_fix | 4,068 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
if len ( sys . argv ) >= 3 :
if len ( sys . argv [ 1 ] ) >= 114 and len ( sys . argv [ 2 ] ) >= 114 :
r = "str"
for i in range ( 114 ) :
a = ord ( sys . argv [ 1 ] [ i ] )
b = ord ( sys . argv [ 2 ] [ i ] )
r = r + chr ( 48 ^ a ^ b )
print ( r )
| このpythonコードに誤りはありません。 | code_fix | 4,069 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _on_mapping_length ( self , instance , value ) :
if self . _loaded :
self . channel_cfg . mapping . length = instance . getValueFromKey ( value )
| このpythonコードに誤りはありません。 | code_fix | 4,070 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class HexUtilsError ( Exception ) :
"str"
pass
| このpythonコードに誤りはありません。 | code_fix | 4,071 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run ( ) :
"str"
parser = argparse . ArgumentParser ( prog = "str" )
parser . add_argument ( "str" , nargs = "str" , help = "str" )
args = parser . parse_args ( )
inputs = { "str" : args . p }
config_path = inputs [ "str" ]
config = SRConfig ( "str" , config_path , "str" )
savings_rate = SavingsRate ( config )
monthly_rates = savings_rate . get_monthly_savings_rates ( )
user_plot = Plot ( savings_rate )
user_plot . plot_savings_rates ( monthly_rates )
| このpythonコードに誤りはありません。 | code_fix | 4,072 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def ave ( self ) :
"str"
return self . _ave
| このpythonコードに誤りはありません。 | code_fix | 4,073 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def redis_set_data ( key , cvedata ) :
"str"
if cvedata :
try :
redis_conn = redis . StrictRedis ( host = redis_host , port = redis_port ,
password = redis_pass , db = redis_db )
redis_conn . hmset ( key , cvedata )
redis_conn . expire ( key , 28800 )
except ConnectionError :
utillogger . error ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,074 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def twist ( self ) :
for i in range ( MT64 . n ) :
x = ( self . MT [ i ] & MT64 . upper_mask ) + ( self . MT [ ( i + 1 ) % MT64 . n ] & MT64 . lower_mask )
xA = x >> 1
if x % 2 != 0 :
xA = xA ^ MT64 . a
self . MT [ i ] = self . MT [ ( i + MT64 . m ) % MT64 . n ] ^ xA
self . index = 0
| このpythonコードに誤りはありません。 | code_fix | 4,075 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Configuration :
__metaclass__ = PoolMeta
__name__ = "str"
default_dunning_procedure = fields . MultiValue ( default_dunning_procedure )
| このpythonコードに誤りはありません。 | code_fix | 4,076 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import patterns
from django . conf . urls import url
from openstack_dashboard . dashboards . admin . networks . ports import views
PORTS = "str"
VIEW_MOD = "str"
urlpatterns = patterns (
VIEW_MOD ,
url ( PORTS % "str" , views . DetailView . as_view ( ) , name = "str" )
)
| このpythonコードに誤りはありません。 | code_fix | 4,077 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DBConnectivity ( SmokeTest ) :
def test_retrieve ( self ) :
cnt = User . objects . all ( ) . count ( )
self . assertTrue ( cnt > 0 )
| このpythonコードに誤りはありません。 | code_fix | 4,078 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_missing_property ( self ) :
recipe = "str"
with self . assertRaisesRegex ( TaskError , "str" ) :
construct ( io . StringIO ( recipe ) , [ "str" ] )
| このpythonコードに誤りはありません。 | code_fix | 4,079 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def make_projectname ( mxd02file ) :
"str"
rad_parts = mxd02file . split ( "str" ) [ : 4 ]
rad_parts . extend ( [ "str" ] )
out_file = "str" . join ( rad_parts )
return out_file
| このpythonコードに誤りはありません。 | code_fix | 4,080 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import unittest
from mock import Mock , call
from . storage_backends import FilesystemBackend , BackendFailureException
from . . env import constants
| このpythonコードに誤りはありません。 | code_fix | 4,081 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _prepare_lines_for_comments ( lines ) :
"str"
for line in lines :
try :
yield {
"str" : line [ 3 ] ,
"str" : int ( line [ 1 ] ) ,
"str" : line [ 0 ] [ 2 : ] if line [ 0 ] . startswith ( "str" ) else line [ 0 ] ,
"str" : int ( line [ 2 ] ) ,
}
except Exception :
pass
| このpythonコードに誤りはありません。 | code_fix | 4,082 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import datetime
from operator import attrgetter
from unittest import expectedFailure
from django import forms
from django . test import TestCase
from . models import (
ArticleWithAuthor , BachelorParty , BirthdayParty , BusStation , Child ,
DerivedM , InternalCertificationAudit , ItalianRestaurant , M2MChild ,
MessyBachelorParty , ParkingLot , ParkingLot3 , ParkingLot4A , ParkingLot4B ,
Person , Place , Profile , QualityControl , Restaurant , SelfRefChild ,
SelfRefParent , Senator , Supplier , TrainStation , User , Wholesaler ,
)
| このpythonコードに誤りはありません。 | code_fix | 4,083 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import routes
import webapp2
config = { }
app = webapp2 . WSGIApplication ( debug = True , config = config )
routes . add_routes ( app )
| このpythonコードに誤りはありません。 | code_fix | 4,084 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_provides_without_prefix ( self ) :
"str"
out = self . _spec_test_output ( "str" )
assert len ( out ) == 1
assert "str" in out [ 0 ]
| このpythonコードに誤りはありません。 | code_fix | 4,085 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def query_readings ( self ) :
queryMsg = "str" + self . collection + "str"
response = requests . post ( self . query_url , data = queryMsg )
try :
return json . loads ( response . content )
except Exception as e :
return response . content
| このpythonコードに誤りはありません。 | code_fix | 4,086 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
BOT_NAME = "str"
SPIDER_MODULES = [ "str" ]
NEWSPIDER_MODULE = "str"
MONGO_USER = os . environ . get ( "str" )
MONGO_PASSWORD = os . environ . get ( "str" )
MONGO_URI = "str"
MONGO_DATABASE = "str"
ITEM_PIPELINES = {
BOT_NAME + "str" : 300 ,
BOT_NAME + "str" : 301 ,
BOT_NAME + "str" : 302 ,
BOT_NAME + "str" : 303 ,
}
| このpythonコードに誤りはありません。 | code_fix | 4,087 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def recv ( self ) :
self . _check_closed ( )
self . _check_readable ( )
buf = self . conn . recv_bytes ( )
f = StringIO ( buf )
return Unpickler ( f ) . load ( )
| このpythonコードに誤りはありません。 | code_fix | 4,088 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def generate ( regex , Ns ) :
"str"
return sorted ( parser . regex ( regex ) [ 0 ] ( Ns ) ,
key = lambda s : ( len ( s ) , s ) )
| このpythonコードに誤りはありません。 | code_fix | 4,089 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_get_static_analysis ( client ) :
rv = client . get (
url_for ( "str" , sha256 = "str" )
)
assert rv . status_code == 404
| このpythonコードに誤りはありません。 | code_fix | 4,090 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import sys
from decimal import decimal , round_down
import json
import random
import shutil
import subprocess
import time
import re
from authproxy import authserviceproxy , jsonrpcexception
| このpythonコードに誤りはありません。 | code_fix | 4,091 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def is_read_only ( statement ) :
config = statement . search_one ( "str" )
return config and ( "str" in config . arg )
| このpythonコードに誤りはありません。 | code_fix | 4,092 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def appendShape ( self , shape ) :
self . shapes . append ( shape )
self . empty = False
self . enableUpdates ( )
| このpythonコードに誤りはありません。 | code_fix | 4,093 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__revision__ = "str"
"str"
import os
import sys
import TestSCons
test = TestSCons . TestSCons ( )
if os . name != "str" or sys . platform == "str" :
msg = "str" % os . name
test . skip_test ( msg )
test . write ( "str" , "str" )
test . run ( arguments = "str" , stdout = "str" )
test . pass_test ( )
| このpythonコードに誤りはありません。 | code_fix | 4,094 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Tweet ( models . Model ) :
tweet_id = models . CharField ( max_length = 21 )
def __str__ ( self ) :
return self . tweet_id
| このpythonコードに誤りはありません。 | code_fix | 4,095 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _db_thread_to_satyr ( self , db_thread ) :
if len ( db_thread . frames ) < 1 :
self . log_warn ( "str"
. format ( db_thread . id ) )
return None
result = satyr . JavaThread ( )
result . name = "str" . format ( db_thread . number )
for db_frame in db_thread . frames :
frame = self . _db_frame_to_satyr ( db_frame )
if frame is None :
continue
result . frames . append ( frame )
return result
| このpythonコードに誤りはありません。 | code_fix | 4,096 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_current_level ( self , achievement_name ) :
"str"
achievement = [ a for a in self . unlocked_achievements if a . name == achievement_name ]
achievement . sort ( key = lambda a : a . level , reverse = True )
if len ( achievement ) == 0 :
current_level = 0
else :
current_level = achievement [ 0 ] . level
return current_level
| このpythonコードに誤りはありません。 | code_fix | 4,097 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def main ( ) :
data_dir = sys . argv [ 1 ]
evaluate_model ( data_dir )
| このpythonコードに誤りはありません。 | code_fix | 4,098 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
from django import forms
from django . http import HttpResponseRedirect
from django . views . generic import View
from django . shortcuts import render_to_response , render
from django . core . urlresolvers import reverse
from django . contrib . auth import login
from django . contrib . auth import authenticate
from public . forms import UserSignupForm
| このpythonコードに誤りはありません。 | code_fix | 4,099 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
Subsets and Splits
Python Code Generation
Provides a structured view of code generation tasks specific to a Python-focused course, helping to understand the nature and sequence of the instructions and outputs.
Filtered Code Generation Tasks
The query extracts code generation questions and answers from a specific dataset source, offering structured insights into its contents.
Code Generation Instruction Split
The query processes and splits code generation outputs into separate answers, providing a structured view of potential alternative solutions for each instruction.
Filtered Code Generation Task
The query performs basic filtering and returns formatted data related to code generation tasks, which is helpful but does not provide deep insights into the dataset's underlying structure or patterns.
Code Generation Instructions
The query performs basic filtering to select code generation tasks and organizes them by license, source, and index, providing a simple overview but lacking deeper analytical insight.
Code Generation Instructions
The query performs basic filtering and selects specific columns, providing limited insight into the dataset's structure but not revealing deeper patterns or relationships.
Code Generation Instructions
The query performs basic filtering and selection, organizing code generation tasks by license and source but does not provide deep insights into the data.
^_Call_Call:::^_Call_Call:
The query performs basic filtering and selection, organizing code generation tasks by license, source, and index without revealing deeper insights.
^^^_Call.FromSeconds:^^ withheld^
The query performs basic filtering and ordering of dataset entries, providing a structured view but lacking deeper insights.
_Call^^^^^ serotonin^:^
The query performs basic data retrieval and organization, presenting specific fields in a structured format but without providing significant analytical insights.