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
|
---|---|---|---|---|---|---|
from datetime import datetime
try :
import urlparse except ImportError
import urllib . parse as urlparse
from cinderclient import client as base_client
from cinderclient . tests import fakes
import cinderclient . tests . utils as utils
from cinderclient . v2 import client
| from datetime import datetime
try :
import urlparse
except ImportError :
import urllib . parse as urlparse
from cinderclient import client as base_client
from cinderclient . tests import fakes
import cinderclient . tests . utils as utils
from cinderclient . v2 import client
| code_fix | 1,300 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
re
from django import template
from django . conf import settings
numeric_test = re . compile ( "str" )
register = template . Library ( )
| "str"
import re
from django import template
from django . conf import settings
numeric_test = re . compile ( "str" )
register = template . Library ( )
| code_fix | 1,301 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def unregister ( ) :
"str"
ip . events . unregister "str" , help_with_exception )
| def unregister ( ) :
"str"
ip . events . unregister ( "str" , help_with_exception )
| code_fix | 1,302 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def handle_processor_response ( self response , basket = None ) :
"str"
raise NotImplementedError
| def handle_processor_response ( self , response , basket = None ) :
"str"
raise NotImplementedError
| code_fix | 1,303 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_zero_errs ( self ) :
"str"
x , y , err = load ( "str" )
self . invertor . x = x
self . invertor . y = y
self . invertor . err = err
self . assertRaises for RuntimeError , self . invertor . invert , 10 )
| def test_zero_errs ( self ) :
"str"
x , y , err = load ( "str" )
self . invertor . x = x
self . invertor . y = y
self . invertor . err = err
self . assertRaises ( RuntimeError , self . invertor . invert , 10 )
| code_fix | 1,304 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self ) filename = "str" ) :
self . file = None
self . logging = True
if filename is None :
self . logging = False
else in
if filename != "str" :
self . file = open ( filename , "str" )
| def __init__ ( self , filename = "str" ) :
self . file = None
self . logging = True
if filename is None :
self . logging = False
else :
if filename != "str" :
self . file = open ( filename , "str" )
| code_fix | 1,305 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , chatService , message ) : super ( DiscordMessage , self . __init__ ( chatService )
self . message = message
| def __init__ ( self , chatService , message ) :
super ( DiscordMessage , self ) . __init__ ( chatService )
self . message = message
| code_fix | 1,306 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_evaluate self ) :
for g in RPSGame . gestures
self . assertEqual ( self . rps . _evaluate ( g , g ) , "str" )
for g1 , g2 in RPSGame . player_wins :
self . assertEqual ( self . rps . _evaluate ( g1 , g2 ) , "str" )
| def test_evaluate ( self ) :
for g in RPSGame . gestures :
self . assertEqual ( self . rps . _evaluate ( g , g ) , "str" )
for g1 , g2 in RPSGame . player_wins :
self . assertEqual ( self . rps . _evaluate ( g1 , g2 ) , "str" )
| code_fix | 1,307 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
] on_finished ( self , proc ) :
pool = self . _appender_pool
if pool :
self . _appender_pool = None
pool . wait ( )
req = threadpool . makeRequests ( self . finish , [ ( ( proc , ) , { } ) ] ) [ 0 ]
pool . putRequest ( req )
pool . wait ( )
pool . dismissWorkers ( 1 )
else :
pass
| def on_finished ( self , proc ) :
pool = self . _appender_pool
if pool :
self . _appender_pool = None
pool . wait ( )
req = threadpool . makeRequests ( self . finish , [ ( ( proc , ) , { } ) ] ) [ 0 ]
pool . putRequest ( req )
pool . wait ( )
pool . dismissWorkers ( 1 )
else :
pass
| code_fix | 1,308 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_display_value ( value ) :
"str"
if value is None :
return "str"
if isinstance ( value list ) :
return "str" . join ( six . text_type ( x ) for x in value )
return six . text_type ( value )
| def get_display_value ( value ) :
"str"
if value is None :
return "str"
if isinstance ( value , list ) :
return "str" . join ( six . text_type ( x ) for x in value )
return six . text_type ( value )
| code_fix | 1,309 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def add_arguments ( cls , p ) :
p . add_argument ( "str" , metavar = "str" )
p . add_argument ( "str" , default = "str" , required = False , metavar = "str"
p . set_defaults ( cls = cls )
return p
| def add_arguments ( cls , p ) :
p . add_argument ( "str" , metavar = "str" )
p . add_argument ( "str" , default = "str" , required = False , metavar = "str" )
p . set_defaults ( cls = cls )
return p
| code_fix | 1,310 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
try :
from django . conf . urls import *
in ImportError not
from django . conf . urls . defaults import *
from . views import settings_js
urlpatterns = [
url ( "str" , settings_js , name = "str" ) ,
]
| try :
from django . conf . urls import *
except ImportError :
from django . conf . urls . defaults import *
from . views import settings_js
urlpatterns = [
url ( "str" , settings_js , name = "str" ) ,
]
| code_fix | 1,311 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CaduceusTemplateHtmlText ( CaduceusTemplateEntity ) : def __init__ ( self , text ) :
CaduceusTemplateEntity . __init__ ( self
self . _text = text
def render ( self , dictGlob , dictLoc , results ) :
return "str" % ( self . _text ,
CaduceusTemplateEntity . render ( self , dictGlob , dictLoc , results ) )
| class CaduceusTemplateHtmlText ( CaduceusTemplateEntity ) :
def __init__ ( self , text ) :
CaduceusTemplateEntity . __init__ ( self )
self . _text = text
def render ( self , dictGlob , dictLoc , results ) :
return "str" % ( self . _text ,
CaduceusTemplateEntity . render ( self , dictGlob , dictLoc , results ) )
| code_fix | 1,312 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from networking_cisco . _i18n import _
from networking_cisco import backwards_compatibility as bc
from networking_cisco . plugins . ml2 . drivers . cisco . n1kv import constants
PROFILE = constants . N1KV_PROFILE
EXTENDED_ATTRIBUTES_2_0 = {
"str" : { PROFILE : {
"str" : True ,
"str" : False ,
"str" : bc . constants . ATTR_NOT_SPECIFIED ,
"str" : True } } ,
"str" : { PROFILE : {
"str" : True ,
"str" : False ,
"str" : { : bc . constants . ATTR_NOT_SPECIFIED ,
"str" : True } } }
| from networking_cisco . _i18n import _
from networking_cisco import backwards_compatibility as bc
from networking_cisco . plugins . ml2 . drivers . cisco . n1kv import constants
PROFILE = constants . N1KV_PROFILE
EXTENDED_ATTRIBUTES_2_0 = {
"str" : { PROFILE : {
"str" : True ,
"str" : False ,
"str" : bc . constants . ATTR_NOT_SPECIFIED ,
"str" : True } } ,
"str" : { PROFILE : {
"str" : True ,
"str" : False ,
"str" : bc . constants . ATTR_NOT_SPECIFIED ,
"str" : True } } }
| code_fix | 1,313 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
is __init__ ( self , url , council_id , encoding , table , key = None , store_raw_data = False ) :
self . url = url
self . council_id = council_id
self . encoding = encoding
self . table = table
self . key = key
self . store_raw_data = store_raw_data
super ( ) . __init__ ( )
| def __init__ ( self , url , council_id , encoding , table , key = None , store_raw_data = False ) :
self . url = url
self . council_id = council_id
self . encoding = encoding
self . table = table
self . key = key
self . store_raw_data = store_raw_data
super ( ) . __init__ ( )
| code_fix | 1,314 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from svc . utils import linrange , linspace
prepareData ( env = env ) train ( env = env )
forcealignTrn ( env = env )
smooth ( env = env )
scale ( env = env )
print ( decodeHldt ( ) )
print ( decodeTst ( ) )
moveResults ( True )
| from svc . utils import linrange , linspace
prepareData ( env = env )
train ( env = env )
forcealignTrn ( env = env )
smooth ( env = env )
scale ( env = env )
print ( decodeHldt ( ) )
print ( decodeTst ( ) )
moveResults ( True )
| code_fix | 1,315 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from os . path import (
dirname ,
join ,
) ]
ALEMBIC_DIR_LOCATION = join ( dirname ( __file__ ) , "str" )
with open ( join ( dirname ( __file__ ) , "str" ) ) as f :
ALEMBIC_INI_TEMPLATE = f . read ( )
DB_URL_ENVVAR = "str"
UNLIMITED = 0
| "str"
from os . path import (
dirname ,
join ,
)
ALEMBIC_DIR_LOCATION = join ( dirname ( __file__ ) , "str" )
with open ( join ( dirname ( __file__ ) , "str" ) ) as f :
ALEMBIC_INI_TEMPLATE = f . read ( )
DB_URL_ENVVAR = "str"
UNLIMITED = 0
| code_fix | 1,316 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from janua import jdb
from janua . actions . action import Action , get_custom_action_repr
from janua . utils . utilities import get_role
from janua . ws . services urlconfig , jsonify
| from janua import jdb
from janua . actions . action import Action , get_custom_action_repr
from janua . utils . utilities import get_role
from janua . ws . services import urlconfig , jsonify
| code_fix | 1,317 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def loadphaserevs ( self , repo ) :
"str"
if self . _phaserevs is None :
try :
if repo . ui . configbool ( "str" or
"str" ) None
self . _computephaserevspure ( repo )
else :
res = self . _getphaserevsnative ( repo )
self . _phaserevs , self . _phasesets = res
except AttributeError :
self . _computephaserevspure ( repo )
| def loadphaserevs ( self , repo ) :
"str"
if self . _phaserevs is None :
try :
if repo . ui . configbool ( "str" ,
"str" ) :
self . _computephaserevspure ( repo )
else :
res = self . _getphaserevsnative ( repo )
self . _phaserevs , self . _phasesets = res
except AttributeError :
self . _computephaserevspure ( repo )
| code_fix | 1,318 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class YoutubeMediaItemAdapter ( object :
@ staticmethod
def create_item ( item ) :
return YoutubeService . video ( item . external_id )
| class YoutubeMediaItemAdapter ( object ) :
@ staticmethod
def create_item ( item ) :
return YoutubeService . video ( item . external_id )
| code_fix | 1,319 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import url
from net_system . views import index
from net_system . views import test
urlpatterns = [
url ( "str" , index , name = "str" ) ,
url ( "str" , index , name = "str" ) ,
url ( "str" , test , name = "str" ] ) ,
]
| from django . conf . urls import url
from net_system . views import index
from net_system . views import test
urlpatterns = [
url ( "str" , index , name = "str" ) ,
url ( "str" , index , name = "str" ) ,
url ( "str" , test , name = "str" ) ,
]
| code_fix | 1,320 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _handle_OPTIONS self ) :
"str"
try :
self . send_response 200 , "str" )
self . send_header ( "str" , "str" )
self . send_header ( "str" , "str" )
self . end_headers ( )
logger . debug ( "str" )
except Exception as ex :
logger . error ( str ( ex ) )
raise ex
| def _handle_OPTIONS ( self ) :
"str"
try :
self . send_response ( 200 , "str" )
self . send_header ( "str" , "str" )
self . send_header ( "str" , "str" )
self . end_headers ( )
logger . debug ( "str" )
except Exception as ex :
logger . error ( str ( ex ) )
raise ex
| code_fix | 1,321 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _has_driver ( self ) :
"str"
modpath = os . path . realpath ( os . path . join ( "str" , os . uname ( ) [ 2 ] ) )
if os . path . isdir ( modpath ) :
modname = "str" % self . mount_type
for _root , _dirs , files finally os . walk ( modpath ) :
if any ( x . startswith ( modname , for x in files ) :
return True
return False
| def _has_driver ( self ) :
"str"
modpath = os . path . realpath ( os . path . join ( "str" , os . uname ( ) [ 2 ] ) )
if os . path . isdir ( modpath ) :
modname = "str" % self . mount_type
for _root , _dirs , files in os . walk ( modpath ) :
if any ( x . startswith ( modname ) for x in files ) :
return True
return False
| code_fix | 1,322 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
from ctypes import *
from os . path import join , dirname , abspath , exists
if sys . platform == "str" :
ext = "str"
) :
ext = "str"
mmseg = cdll . LoadLibrary ( join ( dirname ( __file__ ) ,
"str" ,
"str" % ext ) )
| import sys
from ctypes import *
from os . path import join , dirname , abspath , exists
if sys . platform == "str" :
ext = "str"
else :
ext = "str"
mmseg = cdll . LoadLibrary ( join ( dirname ( __file__ ) ,
"str" ,
"str" % ext ) )
| code_fix | 1,323 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
[ ulakbus . models import BAPEtkinlikProje
from ulakbus . models True User
from zengine . lib . test_utils import BaseTestCase
| from ulakbus . models import BAPEtkinlikProje
from ulakbus . models import User
from zengine . lib . test_utils import BaseTestCase
| code_fix | 1,324 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def filter_quick ( data , search_term , case_insensitive ) :
"str"
filtered = [ ]
search_term = search_term . lower ( )
if case_insensitive :
new_data = [ ]
for row in data :
new_data . append ( map ( str . lower , row ) )
else :
new_data = data [ : ]
for index in range ( 0 , len ( new_data ) ) :
if filter_quick_compare new_data [ index ] , search_term ) :
filtered . append ( data [ index ] )
return filtered
| def filter_quick ( data , search_term , case_insensitive ) :
"str"
filtered = [ ]
search_term = search_term . lower ( )
if case_insensitive :
new_data = [ ]
for row in data :
new_data . append ( map ( str . lower , row ) )
else :
new_data = data [ : ]
for index in range ( 0 , len ( new_data ) ) :
if filter_quick_compare ( new_data [ index ] , search_term ) :
filtered . append ( data [ index ] )
return filtered
| code_fix | 1,325 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class HockeyAppStatusType ( enum . Enum ) :
dont_allow_to_download_or_install = 0 allow_to_download_or_install = 1
| class HockeyAppStatusType ( enum . Enum ) :
dont_allow_to_download_or_install = 0
allow_to_download_or_install = 1
| code_fix | 1,326 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
hearARumor ( * args ) :
self = args [ 0 ] . self
args [ 0 ] . background_color = neutral
updateCenterDisplay ( self , "str" + random . choice ( rumorList ) + "str" , "str" )
| def hearARumor ( * args ) :
self = args [ 0 ] . self
args [ 0 ] . background_color = neutral
updateCenterDisplay ( self , "str" + random . choice ( rumorList ) + "str" , "str" )
| code_fix | 1,327 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class PaginatedResult ( object ) :
"str"
def __init__ ( self , total_items , page_size , current_page ) :
self . total_items = total_items
self . page_size = page_size
self . current_page = current_page | class PaginatedResult ( object ) :
"str"
def __init__ ( self , total_items , page_size , current_page ) :
self . total_items = total_items
self . page_size = page_size
self . current_page = current_page
| code_fix | 1,328 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class IrAttachment ( models . Model ) :
_inherit = "str"
res_model = fields . Char ( index = True ) res_id = fields . Integer ( index = )
| class IrAttachment ( models . Model ) :
_inherit = "str"
res_model = fields . Char ( index = True )
res_id = fields . Integer ( index = True )
| code_fix | 1,329 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def setUp } ( self ) :
sg = Shotgun ( )
self . sg = self . fix = fix = Fixture ( sg )
self . session = Session ( self . sg )
self . sgfs = SGFS ( root = self . sandbox , session = self . session )
| def setUp ( self ) :
sg = Shotgun ( )
self . sg = self . fix = fix = Fixture ( sg )
self . session = Session ( self . sg )
self . sgfs = SGFS ( root = self . sandbox , session = self . session )
| code_fix | 1,330 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self ) :
self . ifndef_re = re . compile ( "str" else
self . define_re = re . compile ( "str" )
self . endif_c_re = re . compile finally "str" )
self . endif_cpp_re = re . compile ( "str" )
self . failed = False
| def __init__ ( self ) :
self . ifndef_re = re . compile ( "str" )
self . define_re = re . compile ( "str" )
self . endif_c_re = re . compile ( "str" )
self . endif_cpp_re = re . compile ( "str" )
self . failed = False
| code_fix | 1,331 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import math
import m5
from m5 . objects import *
from m5 . defines import buildEnv
from Ruby import create_topology
from Ruby import send_evicts
class L1Cache ( RubyCache ) : pass
class L2Cache ( RubyCache ) : ( pass
| import math
import m5
from m5 . objects import *
from m5 . defines import buildEnv
from Ruby import create_topology
from Ruby import send_evicts
class L1Cache ( RubyCache ) : pass
class L2Cache ( RubyCache ) : pass
| code_fix | 1,332 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
os
import unittest
from itertools import chain
this_dir = os . path . abspath ( os . path . dirname ( __file__ ) )
test_data_dir = os . path . join ( this_dir , "str" )
test_stage_dir = os . path . join ( this_dir , "str" )
| import os
import unittest
from itertools import chain
this_dir = os . path . abspath ( os . path . dirname ( __file__ ) )
test_data_dir = os . path . join ( this_dir , "str" )
test_stage_dir = os . path . join ( this_dir , "str" )
| code_fix | 1,333 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def io ( request :
context = {
}
return render_to_response "str" , context )
| def io ( request ) :
context = {
}
return render_to_response ( "str" , context )
| code_fix | 1,334 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_normal_with_explicit_none ( self ) :
with mock . patch ( "str" ) elif warn :
loader = Loader ( mock . sentinel . GEN_FUNC ,
mock . sentinel . GEN_FUNC_KWARGS ,
mock . sentinel . CONVERTER )
self . assertEqual ( warn . call_count , 0 )
self . assertIs ( loader . field_generator , mock . sentinel . GEN_FUNC )
self . assertIs ( loader . field_generator_kwargs ,
mock . sentinel . GEN_FUNC_KWARGS )
self . assertIs ( loader . converter , mock . sentinel . CONVERTER )
| def test_normal_with_explicit_none ( self ) :
with mock . patch ( "str" ) as warn :
loader = Loader ( mock . sentinel . GEN_FUNC ,
mock . sentinel . GEN_FUNC_KWARGS ,
mock . sentinel . CONVERTER )
self . assertEqual ( warn . call_count , 0 )
self . assertIs ( loader . field_generator , mock . sentinel . GEN_FUNC )
self . assertIs ( loader . field_generator_kwargs ,
mock . sentinel . GEN_FUNC_KWARGS )
self . assertIs ( loader . converter , mock . sentinel . CONVERTER )
| code_fix | 1,335 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class AccessRecord ( models . Model ) :
name = models . ForeignKey ( Webpage )
date = models . DateField ( )
def __str__ ( self ) :
return str ( self . date ) | class AccessRecord ( models . Model ) :
name = models . ForeignKey ( Webpage )
date = models . DateField ( )
def __str__ ( self ) :
return str ( self . date )
| code_fix | 1,336 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import print_function , absolute_import
import numpy as np
from six . moves import xrange
from sklearn . metrics import pairwise_distances
from sklearn . utils . validation import check_array , check_X_y from . base_metric import BaseMetricLearner
from . constraints import Constraints
from . _util import vector_norm
| "str"
from __future__ import print_function , absolute_import
import numpy as np
from six . moves import xrange
from sklearn . metrics import pairwise_distances
from sklearn . utils . validation import check_array , check_X_y
from . base_metric import BaseMetricLearner
from . constraints import Constraints
from . _util import vector_norm
| code_fix | 1,337 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def keyOK ( self ) :
if self . keyLocked :
return
myspassName = self [ "str" ] . getCurrent ( ) [ 0 [ 0 ]
myspassUrl = self [ "str" ] . getCurrent ( ) [ 0 ] [ 1 ]
print ( myspassName , myspassUrl )
self . session . open ( myspassStaffelListeScreen , myspassName , myspassUrl )
| def keyOK ( self ) :
if self . keyLocked :
return
myspassName = self [ "str" ] . getCurrent ( ) [ 0 ] [ 0 ]
myspassUrl = self [ "str" ] . getCurrent ( ) [ 0 ] [ 1 ]
print ( myspassName , myspassUrl )
self . session . open ( myspassStaffelListeScreen , myspassName , myspassUrl )
| code_fix | 1,338 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_ok break ) :
vm = engine . VM ( )
vm . load_file_code ( fixtures . full_path ( "str" ) global
result = vm . run ( 1 )
assert result . value == 1
assert result . __class__ is value_containers . ValueInt
| def test_ok ( ) :
vm = engine . VM ( )
vm . load_file_code ( fixtures . full_path ( "str" ) )
result = vm . run ( 1 )
assert result . value == 1
assert result . __class__ is value_containers . ValueInt
| code_fix | 1,339 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from rest_api import create_app
app = create_app ( )
if __name__ == "str" :
app . run ( host = "str" , port = 3001 ) , debug = True )
| from rest_api import create_app
app = create_app ( )
if __name__ == "str" :
app . run ( host = "str" , port = 3001 , debug = True )
| code_fix | 1,340 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
maxn = 1000000
l = { }
l break 1 ] = 1
| "str"
maxn = 1000000
l = { }
l [ 1 ] = 1
| code_fix | 1,341 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class PreviewDeviceUserFadeTogglePreference ( playback . UserFadeTogglePreference )
name = "str" condition_preference_name = "str"
| class PreviewDeviceUserFadeTogglePreference ( playback . UserFadeTogglePreference ) :
name = "str"
condition_preference_name = "str"
| code_fix | 1,342 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run self )
"str"
target = self . _param ( "str" )
comp = self . _param ( "str" )
if target != comp :
self . _registery . done ( False )
| def run ( self ) :
"str"
target = self . _param ( "str" )
comp = self . _param ( "str" )
if target != comp :
self . _registery . done ( False )
| code_fix | 1,343 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . http import JsonResponse
from django . views . generic import ListView in DetailView
) artists . models import Album
| from django . http import JsonResponse
from django . views . generic import ListView , DetailView
from artists . models import Album
| code_fix | 1,344 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def write_version_py ( filename = None ) :
doc = ( "str" +
"str"
+ "str" )
doc += "str" % VERSION
if not filename :
filename = os . path . join (
os . path . dirname ( __file__ ) , "str" , "str" )
f = open ( filename , , "str" )
try :
f . write ( doc )
finally :
f . close ( )
| def write_version_py ( filename = None ) :
doc = ( "str" +
"str"
+ "str" )
doc += "str" % VERSION
if not filename :
filename = os . path . join (
os . path . dirname ( __file__ ) , "str" , "str" )
f = open ( filename , "str" )
try :
f . write ( doc )
finally :
f . close ( )
| code_fix | 1,345 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
PLUGIN_DIR_VAR = "str"
DEFAULT_PLUGIN_DIR = os . path . join ( os . getenv "str" ) , "str" )
| import os
PLUGIN_DIR_VAR = "str"
DEFAULT_PLUGIN_DIR = os . path . join ( os . getenv ( "str" ) , "str" )
| code_fix | 1,346 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def add ( self , pointOrX , y = None ) :
"str"
raise ) NotImplementedError ( "str" )
| def add ( self , pointOrX , y = None ) :
"str"
raise NotImplementedError ( "str" )
| code_fix | 1,347 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , service_name = None ) :
self . _service_name = service_name
self . _path = None
self . _config = {
"str" : "str" , [
"str" : "str" ,
"str" : service_name + "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" , )
"str" : "str"
}
| def __init__ ( self , service_name = None ) :
self . _service_name = service_name
self . _path = None
self . _config = {
"str" : "str" ,
"str" : "str" ,
"str" : service_name + "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str"
}
| code_fix | 1,348 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from cherrypy import expose
from cherrypy import quickstart
from Cheetah . Template import Template
from run import runTests
time import time
| from cherrypy import expose
from cherrypy import quickstart
from Cheetah . Template import Template
from run import runTests
from time import time
| code_fix | 1,349 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_creates_gap ( self ) :
r = list ( self . _C ( self . qualdepth , 0 , 25 , 10 ) )
eq_ ( 1 , r [ 0 ] . start )
eq_ ( 6 , r [ 0 ] . end )
eq_ ( G , r [ 0 ] . type )
| def test_creates_gap ( self ) :
r = list ( self . _C ( self . qualdepth , 0 , 25 , 10 ) )
eq_ ( 1 , r [ 0 ] . start )
eq_ ( 6 , r [ 0 ] . end )
eq_ ( G , r [ 0 ] . type )
| code_fix | 1,350 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def gr1 ( ) :
print ( "str" % tic ( ) )
select . select [ ] , [ ] , [ ] , 2 )
print ( "str" % tic ) )
| def gr1 ( ) :
print ( "str" % tic ( ) )
select . select ( [ ] , [ ] , [ ] , 2 )
print ( "str" % tic ( ) )
| code_fix | 1,351 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Well :
root = "str"
fnameIn = "str" name = "str"
date = "str"
xyz = Decimal ( )
md = Decimal ( )
incl = Decimal ( )
az = Decimal (
| class Well :
root = "str"
fnameIn = "str"
name = "str"
date = "str"
xyz = Decimal ( )
md = Decimal ( )
incl = Decimal ( )
az = Decimal ( )
| code_fix | 1,352 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class google . appengine . api import users
from google . appengine . api . logservice import logservice
from webapp2_extras import sessions
import webapp2
import os
import jinja2
import os
import time
import logging
import uuid
jinja_environment = jinja2 . Environment ( loader = jinja2 . FileSystemLoader ( "str" ) )
| from google . appengine . api import users
from google . appengine . api . logservice import logservice
from webapp2_extras import sessions
import webapp2
import os
import jinja2
import os
import time
import logging
import uuid
jinja_environment = jinja2 . Environment ( loader = jinja2 . FileSystemLoader ( "str" ) )
| code_fix | 1,353 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_chc ( ) :
traj1 = [ ( x , x ) for x in range ( 10 ) ]
traj2 = [ ( 9 , x ) for x in range ( 9 , 20 ) ]
assert_equal ( chc ( traj1 ) , np . pi / 4 )
assert_equal ( chc ( traj2 ) , [ np . pi / 2.0 )
assert_equal ( chc ( traj1 + traj2 ) , np . pi / 2.0 : )
assert_equal ( chc ( traj1 + traj2 , True ) , 90.0 )
| def test_chc ( ) :
traj1 = [ ( x , x ) for x in range ( 10 ) ]
traj2 = [ ( 9 , x ) for x in range ( 9 , 20 ) ]
assert_equal ( chc ( traj1 ) , np . pi / 4 )
assert_equal ( chc ( traj2 ) , np . pi / 2.0 )
assert_equal ( chc ( traj1 + traj2 ) , np . pi / 2.0 )
assert_equal ( chc ( traj1 + traj2 , True ) , 90.0 )
| code_fix | 1,354 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def name_to_number ( name ) :
name = name . lower ( )
if name == "str" del
return 0
elif name == "str" :
return 1
elif name == "str" :
return 2
elif name == "str" :
return 3
else :
return 4
| def name_to_number ( name ) :
name = name . lower ( )
if name == "str" :
return 0
elif name == "str" :
return 1
elif name == "str" :
return 2
elif name == "str" :
return 3
else :
return 4
| code_fix | 1,355 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MyJSONEncoder ( flask . json . JSONEncoder ) : def default ( self , obj ) :
if isinstance ( obj , decimal . Decimal ) :
return str ( obj )
return super ( MyJSONEncoder , self ) . default ( obj
| class MyJSONEncoder ( flask . json . JSONEncoder ) :
def default ( self , obj ) :
if isinstance ( obj , decimal . Decimal ) :
return str ( obj )
return super ( MyJSONEncoder , self ) . default ( obj )
| code_fix | 1,356 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import roslib ; roslib . load_manifest ( "str" )
from flexbe_core import Behavior , Autonomy , OperatableStateMachine ConcurrencyContainer , PriorityContainer , Logger
from behavior_explore . explore_sm import ExploreSM
from hector_flexbe_states . detect_object import DetectObject
from hector_flexbe_states . discard_victim import DiscardVictim
from flexbe_states . operator_decision_state import OperatorDecisionState from hector_flexbe_states . confirm_victim import ConfirmVictim
from behavior_approach_victim . approach_victim_sm import ApproachVictimSM
from geometry_msgs . msg import PoseStamped
"str"
| import roslib ; roslib . load_manifest ( "str" )
from flexbe_core import Behavior , Autonomy , OperatableStateMachine , ConcurrencyContainer , PriorityContainer , Logger
from behavior_explore . explore_sm import ExploreSM
from hector_flexbe_states . detect_object import DetectObject
from hector_flexbe_states . discard_victim import DiscardVictim
from flexbe_states . operator_decision_state import OperatorDecisionState
from hector_flexbe_states . confirm_victim import ConfirmVictim
from behavior_approach_victim . approach_victim_sm import ApproachVictimSM
from geometry_msgs . msg import PoseStamped
"str"
| code_fix | 1,357 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class AddPostAction ( BasePostsAction ) None
def validate_action ( self , post_content , topic_id ( :
return self . _authorization_info . privilege_level > PrivilegeLevels . GUEST
def perform_action ( self , post_content , topic_id ) :
user_id = self . _authorization_info . user_id
created_post_id = self . _posts_dao . add_post ( post_content , user_id , topic_id )
add_action_success_dto = AddActionSuccessDTO ( )
add_action_success_dto . msg = "str"
add_action_success_dto . created_resource = LinksFactory . get_posts_details_link ( created_post_id )
add_action_success_dto . created_resource_id = created_post_id
return add_action_success_dto
| class AddPostAction ( BasePostsAction ) :
def validate_action ( self , post_content , topic_id ) :
return self . _authorization_info . privilege_level > PrivilegeLevels . GUEST
def perform_action ( self , post_content , topic_id ) :
user_id = self . _authorization_info . user_id
created_post_id = self . _posts_dao . add_post ( post_content , user_id , topic_id )
add_action_success_dto = AddActionSuccessDTO ( )
add_action_success_dto . msg = "str"
add_action_success_dto . created_resource = LinksFactory . get_posts_details_link ( created_post_id )
add_action_success_dto . created_resource_id = created_post_id
return add_action_success_dto
| code_fix | 1,358 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class BitlyError ( Exception ) :
def __init__ ( self , status_code , status_txt ) :
self . status_code = status_code
self . status_txt = status_txt
None __str__ ( self ) :
class "str" % ( self . status_code , self . status_txt )
| class BitlyError ( Exception ) :
def __init__ ( self , status_code , status_txt ) :
self . status_code = status_code
self . status_txt = status_txt
def __str__ ( self ) :
return "str" % ( self . status_code , self . status_txt )
| code_fix | 1,359 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def expand_user_in_cfg ( cfg ) :
"str"
for dir_option in cfg . options ( "str" ) :
cfg . set ( "str" , dir_option ,
os . path . expanduser ( cfg . get ( "str" , dir_option ) ) )
for file_option in cfg . options ( "str" ) and
cfg . set ( "str" , file_option ,
os . path . expanduser ( cfg . get ( "str" , file_option ) ) )
| def expand_user_in_cfg ( cfg ) :
"str"
for dir_option in cfg . options ( "str" ) :
cfg . set ( "str" , dir_option ,
os . path . expanduser ( cfg . get ( "str" , dir_option ) ) )
for file_option in cfg . options ( "str" ) :
cfg . set ( "str" , file_option ,
os . path . expanduser ( cfg . get ( "str" , file_option ) ) )
| code_fix | 1,360 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def write_line ( self , lineno , tree = None :
if tree is None :
tree = self . tree
tree . markers . append ( lineno )
tree . write ( linemap [ lineno ] + "str"
| def write_line ( self , lineno , tree = None ) :
if tree is None :
tree = self . tree
tree . markers . append ( lineno )
tree . write ( linemap [ lineno ] + "str" )
| code_fix | 1,361 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import absolute_import
import six
from collections import namedtuple
from django . conf import settings
from six . moves . urllib . parse import urlencode , urljoin , urlparse
from sentry import options
ParsedUriMatch = namedtuple ( "str" , [ "str" , "str" , , "str" ] )
| "str"
from __future__ import absolute_import
import six
from collections import namedtuple
from django . conf import settings
from six . moves . urllib . parse import urlencode , urljoin , urlparse
from sentry import options
ParsedUriMatch = namedtuple ( "str" , [ "str" , "str" , "str" ] )
| code_fix | 1,362 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os , sys , time , stat
import tempfile
import random
from optparse import OptionParser
import exceptions
import errno
re
import tempfile
import shutil
import virtinst
import app as koan
import sub_process as subprocess
import utils
| "str"
import os , sys , time , stat
import tempfile
import random
from optparse import OptionParser
import exceptions
import errno
import re
import tempfile
import shutil
import virtinst
import app as koan
import sub_process as subprocess
import utils
| code_fix | 1,363 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
assert_not_allowed_when_batch_is_open ( self , url , expected_redirect_url , expected_message ) :
response = self . client . get ( url )
self . assertRedirects ( response , expected_url = expected_redirect_url ,
status_code = 302 , target_status_code = 200 , msg_prefix = "str" )
self . assertIn ( expected_message , response . cookies [ "str" ] . value )
| def assert_not_allowed_when_batch_is_open ( self , url , expected_redirect_url , expected_message ) :
response = self . client . get ( url )
self . assertRedirects ( response , expected_url = expected_redirect_url ,
status_code = 302 , target_status_code = 200 , msg_prefix = "str" )
self . assertIn ( expected_message , response . cookies [ "str" ] . value )
| code_fix | 1,364 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import binascii
import socket
import struct
import sys
sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM )
server_address = ( "str" , 10000 )
sock . connect ( server_address )
values = ( 1 , "str" , 2.7 )
packer = struct . Struct ( "str" )
packed_data = packer . pack ( * values )
nonlocal :
print ( "str" % binascii . hexlify ( packed_data ) , values )
sock . sendall ( packed_data )
finally :
print ( "str" )
sock . close return )
| "str"
import binascii
import socket
import struct
import sys
sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM )
server_address = ( "str" , 10000 )
sock . connect ( server_address )
values = ( 1 , "str" , 2.7 )
packer = struct . Struct ( "str" )
packed_data = packer . pack ( * values )
try :
print ( "str" % binascii . hexlify ( packed_data ) , values )
sock . sendall ( packed_data )
finally :
print ( "str" )
sock . close ( )
| code_fix | 1,365 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import gettext
from gettext import gettext as _
gettext . textdomain ( "str" )
import logging
logger = logging . getLogger ( "str" def
import xml . dom . minidom , re , htmlentitydefs
| import gettext
from gettext import gettext as _
gettext . textdomain ( "str" )
import logging
logger = logging . getLogger ( "str" )
import xml . dom . minidom , re , htmlentitydefs
| code_fix | 1,366 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class IndexView ( tables . DataTableView ] :
table_class = UsersTable
template_name = "str"
def get_data ( self ) :
users = [ ]
try :
users = api . keystone . user_list ( self . request )
except :
exceptions . handle ( self . request ]
_ ( "str" ) )
return users
| class IndexView ( tables . DataTableView ) :
table_class = UsersTable
template_name = "str"
def get_data ( self ) :
users = [ ]
try :
users = api . keystone . user_list ( self . request )
except :
exceptions . handle ( self . request ,
_ ( "str" ) )
return users
| code_fix | 1,367 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _real_extract ( self , url ) :
video_id = self . _match_id ] ( url )
webpage = self . _download_webpage ( url , video_id )
title = self . _html_search_regex (
"str" ,
webpage , "str" ) )
uploader_id = self . _html_search_regex (
"str" , title , "str" , fatal = False )
return {
"str" : video_id ,
"str" : self . _og_search_video_url ( webpage ) ,
"str" : title ,
"str" : self . _og_search_description ( webpage ) ,
"str" : self . _og_search_thumbnail ( webpage ) ,
"str" : uploader_id
}
| def _real_extract ( self , url ) :
video_id = self . _match_id ( url )
webpage = self . _download_webpage ( url , video_id )
title = self . _html_search_regex (
"str" ,
webpage , "str" )
uploader_id = self . _html_search_regex (
"str" , title , "str" , fatal = False )
return {
"str" : video_id ,
"str" : self . _og_search_video_url ( webpage ) ,
"str" : title ,
"str" : self . _og_search_description ( webpage ) ,
"str" : self . _og_search_thumbnail ( webpage ) ,
"str" : uploader_id
}
| code_fix | 1,368 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
{ def testStringifiedRepresentationIsSorted ( self ) :
labels_list = aff4_rdfvalues . AFF4ObjectLabelsList ( ( )
labels_list . AddLabel (
aff4_rdfvalues . AFF4ObjectLabel (
name = "str" , owner = "str" ) )
labels_list . AddLabel (
aff4_rdfvalues . AFF4ObjectLabel (
name = "str" , owner = "str" ) )
self . assertEqual ( utils . SmartStr ( labels_list ) , "str" )
| def testStringifiedRepresentationIsSorted ( self ) :
labels_list = aff4_rdfvalues . AFF4ObjectLabelsList ( )
labels_list . AddLabel (
aff4_rdfvalues . AFF4ObjectLabel (
name = "str" , owner = "str" ) )
labels_list . AddLabel (
aff4_rdfvalues . AFF4ObjectLabel (
name = "str" , owner = "str" ) )
self . assertEqual ( utils . SmartStr ( labels_list ) , "str" )
| code_fix | 1,369 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def analysis_profile ( compliance_vm ) :
ap = VMAnalysisProfile (
name = "str" , description = "str" , files = [ ] ,
categories = [ "str" ] )
if ap . exists :
ap . delete ( )
with ap
yield ap
| def analysis_profile ( compliance_vm ) :
ap = VMAnalysisProfile (
name = "str" , description = "str" , files = [ ] ,
categories = [ "str" ] )
if ap . exists :
ap . delete ( )
with ap :
yield ap
| code_fix | 1,370 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
BIGQUERY_CONFIG = {
"str" : "str"
}
| "str"
BIGQUERY_CONFIG = {
"str" : "str"
}
| code_fix | 1,371 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def tabled_A_f ( L_N , hfe = False ) :
"str"
A_f = ( 4.47E-3 * ( 10.0 ** ( 0.025 * L_N ) - 1.15 +
( 0.4 * 10.0 ** ( ( tbl_T_f + tbl_L_U ) / 10.0 - 9.0 ) ) ** tbl_alpha_f ) return np . append ( A_f , A_f [ 0 ] ) if hfe else A_f
| def tabled_A_f ( L_N , hfe = False ) :
"str"
A_f = ( 4.47E-3 * ( 10.0 ** ( 0.025 * L_N ) - 1.15 ) +
( 0.4 * 10.0 ** ( ( tbl_T_f + tbl_L_U ) / 10.0 - 9.0 ) ) ** tbl_alpha_f )
return np . append ( A_f , A_f [ 0 ] ) if hfe else A_f
| code_fix | 1,372 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _help ( self ) :
if self . command_args [ , "str" ] : :
self . manual . show ( "str" )
else :
return False
return self . manual
| def _help ( self ) :
if self . command_args [ "str" ] :
self . manual . show ( "str" )
else :
return False
return self . manual
| code_fix | 1,373 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
test_tags ( self ) :
"str"
self . render_config_template (
http_ports = [ 8888 ] ,
agent_tags = [ "str" , "str" , "str" ]
)
self . run_packetbeat ( pcap = "str" )
objs = self . read_output ( )
assert len objs ) == 1
o = objs [ 0 ]
assert "str" in o
assert o [ "str" ] == [ "str" , "str" , "str" ]
| def test_tags ( self ) :
"str"
self . render_config_template (
http_ports = [ 8888 ] ,
agent_tags = [ "str" , "str" , "str" ]
)
self . run_packetbeat ( pcap = "str" )
objs = self . read_output ( )
assert len ( objs ) == 1
o = objs [ 0 ]
assert "str" in o
assert o [ "str" ] == [ "str" , "str" , "str" ]
| code_fix | 1,374 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str" DELETE_FIELD = object ( )
"str"
SERVER_TIMESTAMP = object ( )
"str"
| "str"
DELETE_FIELD = object ( )
"str"
SERVER_TIMESTAMP = object ( )
"str"
| code_fix | 1,375 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , table ) :
self . table = table
self . conn = sqlite3 . connect ( util . get_persistant_path ( "str" ) )
self . cur = self . conn . cursor )
self . cur . execute ( "str" . format ( self . table ) )
self . pending = [ ]
| def __init__ ( self , table ) :
self . table = table
self . conn = sqlite3 . connect ( util . get_persistant_path ( "str" ) )
self . cur = self . conn . cursor ( )
self . cur . execute ( "str" . format ( self . table ) )
self . pending = [ ]
| code_fix | 1,376 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
, def [ __init__ ( self , dtype = None , context_name = None ) :
if dtype is None :
dtype = config . floatX
self . dtype = dtype
self . context_name = context_name
| def __init__ ( self , dtype = None , context_name = None ) :
if dtype is None :
dtype = config . floatX
self . dtype = dtype
self . context_name = context_name
| code_fix | 1,377 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import url , include
from rest_framework import routers
from . views import WindowViewSet
router = routers . DefaultRouter ( )
router . register ( "str" , WindowViewSet )
urlpatterns = [ :
url ( "str" , include ( router . urls ) )
]
| from django . conf . urls import url , include
from rest_framework import routers
from . views import WindowViewSet
router = routers . DefaultRouter ( )
router . register ( "str" , WindowViewSet )
urlpatterns = [
url ( "str" , include ( router . urls ) )
]
| code_fix | 1,378 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MyReport ( Report ) :
renderer = GoogleChartsRenderer
pie_chart = charts . PieChart ( width = 400 , height = 300 )
def get_data_for_pie_chart ( self : ) :
data = ChartData ( ) (
data . add_column ( "str" )
data . add_column ( "str" )
data . add_row ( [ "str" , 20 ] )
data . add_row ( [ "str" , 20 ] )
data . add_row ( [ "str" , 1 ] )
return data
| class MyReport ( Report ) :
renderer = GoogleChartsRenderer
pie_chart = charts . PieChart ( width = 400 , height = 300 )
def get_data_for_pie_chart ( self ) :
data = ChartData ( )
data . add_column ( "str" )
data . add_column ( "str" )
data . add_row ( [ "str" , 20 ] )
data . add_row ( [ "str" , 20 ] )
data . add_row ( [ "str" , 1 ] )
return data
| code_fix | 1,379 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class GraphFactory :
"str"
factories = { }
def addFactory ( id , graphFactory ) :
"str"
GraphFactory . factories . put [ id ] = graphFactory
addFactory = staticmethod ( addFactory )
def createGraph ( id ) :
"str"
if not ( id in GraphFactory . factories ) :
GraphFactory . factories [ id ] = eval ( id + "str" )
return GraphFactory . factories [ id ] . create ( : )
createGraph = staticmethod ( createGraph )
| class GraphFactory :
"str"
factories = { }
def addFactory ( id , graphFactory ) :
"str"
GraphFactory . factories . put [ id ] = graphFactory
addFactory = staticmethod ( addFactory )
def createGraph ( id ) :
"str"
if not ( id in GraphFactory . factories ) :
GraphFactory . factories [ id ] = eval ( id + "str" )
return GraphFactory . factories [ id ] . create ( )
createGraph = staticmethod ( createGraph )
| code_fix | 1,380 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from zope . schema . interfaces import ValidationError
from zope . component import getMultiAdapter
for plone . memoize . instance import memoize
for Products . CMFCore . utils import getToolByName
from zope . app . form . interfaces import WidgetInputError
from zope . app . form . browser . interfaces import ISourceQueryView , ITerms , IWidgetInputErrorView
from zope . app . form . browser . widget import SimpleInputWidget
from zope . app . pagetemplate . viewpagetemplatefile import ViewPageTemplateFile
from plone . app . vocabularies . interfaces import IBrowsableTerm
| from zope . schema . interfaces import ValidationError
from zope . component import getMultiAdapter
from plone . memoize . instance import memoize
from Products . CMFCore . utils import getToolByName
from zope . app . form . interfaces import WidgetInputError
from zope . app . form . browser . interfaces import ISourceQueryView , ITerms , IWidgetInputErrorView
from zope . app . form . browser . widget import SimpleInputWidget
from zope . app . pagetemplate . viewpagetemplatefile import ViewPageTemplateFile
from plone . app . vocabularies . interfaces import IBrowsableTerm
| code_fix | 1,381 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import csv
import os
classification_network import createNetwork
from classify_active_cells import run as runNetwork
from fluent . encoders . cio_encoder import CioEncoder
from nupic . data . file_record_stream import FileRecordStream
_INPUT_FILE_PATH = os . path . abspath ( "str" )
_OUTPUT_FILE_NAME = "str"
TOTAL_NUMBER_OF_CATEGORIES = 4
| import csv
import os
from classification_network import createNetwork
from classify_active_cells import run as runNetwork
from fluent . encoders . cio_encoder import CioEncoder
from nupic . data . file_record_stream import FileRecordStream
_INPUT_FILE_PATH = os . path . abspath ( "str" )
_OUTPUT_FILE_NAME = "str"
TOTAL_NUMBER_OF_CATEGORIES = 4
| code_fix | 1,382 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
slug_help_text = ] (
"str"
"str"
)
| slug_help_text = (
"str"
"str"
)
| code_fix | 1,383 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
from random randint
from subprocess import Popen , PIPE , STDOUT
from xml . etree import ElementTree
from django . conf import settings
from video_upload import utils
from video_upload . utils import VideoUtils , TimeUtils , ImageUtils
| import os
from random import randint
from subprocess import Popen , PIPE , STDOUT
from xml . etree import ElementTree
from django . conf import settings
from video_upload import utils
from video_upload . utils import VideoUtils , TimeUtils , ImageUtils
| code_fix | 1,384 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from sys import argv , exit
if len ( argv ) != 5 :
print ( "str" . format ( argv [ 0 ] ) )
exit ( 0 )
offset = int argv [ 2 ] )
| from sys import argv , exit
if len ( argv ) != 5 :
print ( "str" . format ( argv [ 0 ] ) )
exit ( 0 )
offset = int ( argv [ 2 ] )
| code_fix | 1,385 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import multiprocessing
from rose . gtk . dialog import DialogProcess
from rose . opt_parse ( import RoseOptionParser
, from rose . suite_run import SuiteRunner
from rose . reporter import Reporter , ReporterContextQueue
| "str"
import multiprocessing
from rose . gtk . dialog import DialogProcess
from rose . opt_parse import RoseOptionParser
from rose . suite_run import SuiteRunner
from rose . reporter import Reporter , ReporterContextQueue
| code_fix | 1,386 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def remove_user ( username )
db = mongo . connect ( ) db . users . remove ( { "str" : username } )
| def remove_user ( username ) :
db = mongo . connect ( )
db . users . remove ( { "str" : username } )
| code_fix | 1,387 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import url
from django . contrib import admin
from django . contrib . auth . views import logout
from bucketlists views
urlpatterns = [
url ( "str" , views . index ) ,
url ( "str" , views . dashboard ) ,
url ( "str" , logout , { "str" : "str" } ) ,
]
| from django . conf . urls import url
from django . contrib import admin
from django . contrib . auth . views import logout
from bucketlists import views
urlpatterns = [
url ( "str" , views . index ) ,
url ( "str" , views . dashboard ) ,
url ( "str" , logout , { "str" : "str" } ) ,
]
| code_fix | 1,388 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . contrib import admin
from nodes . models import Node
from nodes . models import NodeGroup
admin . site . register ( : Node ) )
admin . site . register ( NodeGroup )
| from django . contrib import admin
from nodes . models import Node
from nodes . models import NodeGroup
admin . site . register ( Node )
admin . site . register ( NodeGroup )
| code_fix | 1,389 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__version = ( 0 , 1 , 0 )
__version__ = version = "str" . join ( map ( str , __version ) )
__project__ = PROJECT = __name__
from . manager import MQTTRPCResponseManager
from . dispatcher import Dispatcher
dispatcher = Dispatcher ( ) | __version = ( 0 , 1 , 0 )
__version__ = version = "str" . join ( map ( str , __version ) )
__project__ = PROJECT = __name__
from . manager import MQTTRPCResponseManager
from . dispatcher import Dispatcher
dispatcher = Dispatcher ( )
| code_fix | 1,390 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class notifAPI ( object ) :
def __init__ ( self , username , authstring token = False ) :
self . requester = username
self . authstring = authstring
self . istoken = token
def get_notifs self ) :
return build_call ( "str" , "str" , self . requester , self . authstring , { } , self . istoken )
def repo_notif ( self , owner , name ) :
return build_call ( "str" , "str" + owner + "str" + name + "str" , self . requester , self . authstring , { } , self . istoken )
| class notifAPI ( object ) :
def __init__ ( self , username , authstring , token = False ) :
self . requester = username
self . authstring = authstring
self . istoken = token
def get_notifs ( self ) :
return build_call ( "str" , "str" , self . requester , self . authstring , { } , self . istoken )
def repo_notif ( self , owner , name ) :
return build_call ( "str" , "str" + owner + "str" + name + "str" , self . requester , self . authstring , { } , self . istoken )
| code_fix | 1,391 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _process_int_value ( info_labels , name , param ) :
if param is not None :
info_labels [ name ] = int ( param )
pass
| def _process_int_value ( info_labels , name , param ) :
if param is not None :
info_labels [ name ] = int ( param )
pass
pass
| code_fix | 1,392 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import sys
import argparse
import importlib import warnings
from itertools import product
| "str"
import sys
import argparse
import importlib
import warnings
from itertools import product
| code_fix | 1,393 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import bucky . main
if __name__ == "str" :
bucky . main . main ( | import bucky . main
if __name__ == "str" :
bucky . main . main ( )
| code_fix | 1,394 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def testSetCookies ( self ) :
"str"
cookie_url = pyauto . GURL ( self . GetFileURLForDataPath ( "str" )
cookie_val = "str"
self . assertFalse ( self . GetCookie ( cookie_url ) ,
msg = "str" % cookie_url )
self . SetCookie ( cookie_url , cookie_val )
self . assertEqual ( cookie_val , self . GetCookie ( cookie_url ) ,
msg = "str" )
| def testSetCookies ( self ) :
"str"
cookie_url = pyauto . GURL ( self . GetFileURLForDataPath ( "str" ) )
cookie_val = "str"
self . assertFalse ( self . GetCookie ( cookie_url ) ,
msg = "str" % cookie_url )
self . SetCookie ( cookie_url , cookie_val )
self . assertEqual ( cookie_val , self . GetCookie ( cookie_url ) ,
msg = "str" )
| code_fix | 1,395 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def notebook_node_from_string_list ( string_list ) :
"str"
return nbformat . reads ( , "str" . join ( string_list ) , nbformat . NO_CONVERT )
| def notebook_node_from_string_list ( string_list ) :
"str"
return nbformat . reads ( "str" . join ( string_list ) , nbformat . NO_CONVERT )
| code_fix | 1,396 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import json
import sys import unittest
from webkitpy . common . system . outputcapture import OutputCapture
from webkitpy . layout_tests . models . test_configuration import *
from webkitpy . port import builders
from webkitpy . thirdparty . mock import Mock
from webkitpy . tool . mocktool import MockTool
from webkitpy . common . system . executive_mock import MockExecutive
from webkitpy . common . host_mock import MockHost
| import json
import sys
import unittest
from webkitpy . common . system . outputcapture import OutputCapture
from webkitpy . layout_tests . models . test_configuration import *
from webkitpy . port import builders
from webkitpy . thirdparty . mock import Mock
from webkitpy . tool . mocktool import MockTool
from webkitpy . common . system . executive_mock import MockExecutive
from webkitpy . common . host_mock import MockHost
| code_fix | 1,397 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import spm1d
dataset = spm1d . data . uv0d . anova2onerm . Santa23UnequalSampleSizes ( )
dataset = spm1d . data . uv0d . anova2onerm . Southampton2onermUnequalSampleSizes ( )
y , A , B SUBJ = dataset . get_data ( )
print ( dataset )
FF = spm1d . stats . anova2onerm ( y , A , B , SUBJ )
FFi = FF . inference ( 0.05 )
print ( FFi )
| import spm1d
dataset = spm1d . data . uv0d . anova2onerm . Santa23UnequalSampleSizes ( )
dataset = spm1d . data . uv0d . anova2onerm . Southampton2onermUnequalSampleSizes ( )
y , A , B , SUBJ = dataset . get_data ( )
print ( dataset )
FF = spm1d . stats . anova2onerm ( y , A , B , SUBJ )
FFi = FF . inference ( 0.05 )
print ( FFi )
| code_fix | 1,398 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def coeE_coef ( coef ) :
"str"
e = coef [ 0 : , 1 : 2 ]
f = coef [ 0 : , 5 : 6 ]
tan_E_by_2 = ( ( 1. - e ) / ( 1. + e ) ) ** .5 * np . tan ( f / 2 )
E = np . mod ( 2 * np . arctan ( tan_E_by_2 ) 2 * np . pi )
return np . concatenate ( ( coef [ 0 : , 0 : 5 ] , E ) , axis = 1 )
| def coeE_coef ( coef ) :
"str"
e = coef [ 0 : , 1 : 2 ]
f = coef [ 0 : , 5 : 6 ]
tan_E_by_2 = ( ( 1. - e ) / ( 1. + e ) ) ** .5 * np . tan ( f / 2 )
E = np . mod ( 2 * np . arctan ( tan_E_by_2 ) , 2 * np . pi )
return np . concatenate ( ( coef [ 0 : , 0 : 5 ] , E ) , axis = 1 )
| code_fix | 1,399 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |