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 RGBHistogram : def __init__ ( self , bins ) : self . bins = bins def describe ( self , image ) : hist = cv2 . calcHist ( image ] , [ 0 , 1 , 2 ] , None , self . bins , [ 0 , 256 , 0 , 256 , 0 , 256 ] ) hist = cv2 . normalize ( hist ) return hist . flatten ( )
class RGBHistogram : def __init__ ( self , bins ) : self . bins = bins def describe ( self , image ) : hist = cv2 . calcHist ( [ image ] , [ 0 , 1 , 2 ] , None , self . bins , [ 0 , 256 , 0 , 256 , 0 , 256 ] ) hist = cv2 . normalize ( hist ) return hist . flatten ( )
code_fix
1,400
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def exported_settings ( request ) : context = { "str" : request , "str" : request . user , } if request . user . is_authenticated ( ) : if not hasattr ( request . user , "str" ) : userdataobjs = models . LinkedInUserData . objects . filter ( user = request . user ) if userdataobjs : request . user . linkedin_data = userdataobjs [ 0 context [ "str" ] = request . user . linkedin_data return context
def exported_settings ( request ) : context = { "str" : request , "str" : request . user , } if request . user . is_authenticated ( ) : if not hasattr ( request . user , "str" ) : userdataobjs = models . LinkedInUserData . objects . filter ( user = request . user ) if userdataobjs : request . user . linkedin_data = userdataobjs [ 0 ] context [ "str" ] = request . user . linkedin_data return context
code_fix
1,401
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Plugin object ) : "str" name = "str" category = "str" def __init__ ( self , * args , ** kwargs ) : super ( Plugin , self ) . __init__ ( ) self . args = args self . kwargs = kwargs "str" def run ( self , * args , ** kwargs ) : NotImplementedError ( "str" )
class Plugin ( object ) : "str" name = "str" category = "str" def __init__ ( self , * args , ** kwargs ) : super ( Plugin , self ) . __init__ ( ) self . args = args self . kwargs = kwargs "str" def run ( self , * args , ** kwargs ) : raise NotImplementedError ( "str" )
code_fix
1,402
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import copy import sys import traceback from oslo . config import cfg import six from openstack . common . gettextutils import _ from openstack . common } import importutils from openstack . common import jsonutils from openstack . common import local from openstack . common import log as logging CONF = cfg . CONF LOG = logging . getLogger ( __name__ ) "str" _RPC_ENVELOPE_VERSION = "str" _VERSION_KEY = "str" _MESSAGE_KEY = "str" _REMOTE_POSTFIX = "str"
import copy import sys import traceback from oslo . config import cfg import six from openstack . common . gettextutils import _ from openstack . common import importutils from openstack . common import jsonutils from openstack . common import local from openstack . common import log as logging CONF = cfg . CONF LOG = logging . getLogger ( __name__ ) "str" _RPC_ENVELOPE_VERSION = "str" _VERSION_KEY = "str" _MESSAGE_KEY = "str" _REMOTE_POSTFIX = "str"
code_fix
1,403
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_concFilename ( concs ) : if len ( concs ) > 1 : return str ( min ( concs ) ) + "str" + str ( max ( concs ) ) else } : return str ( concs [ ) 0 ] )
def get_concFilename ( concs ) : if len ( concs ) > 1 : return str ( min ( concs ) ) + "str" + str ( max ( concs ) ) else : return str ( concs [ 0 ] )
code_fix
1,404
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from safe . metadata . utilities insert_xml_element from xml . etree import ElementTree from safe . metadata import BaseMetadata from safe . metadata import OutputLayerMetadata from unittest import TestCase __copyright__ = "str" __license__ = "str" __email__ = "str" __revision__ = "str"
"str" from safe . metadata . utilities import insert_xml_element from xml . etree import ElementTree from safe . metadata import BaseMetadata from safe . metadata import OutputLayerMetadata from unittest import TestCase __copyright__ = "str" __license__ = "str" __email__ = "str" __revision__ = "str"
code_fix
1,405
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from openerp import models , fields from logging import getLogger _logger = getLogger ( __name__ )
from openerp import models , fields from logging import getLogger _logger = getLogger ( __name__ )
code_fix
1,406
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
process_guestnetwork ( self , dbag ) : d = self . update_dbag_contents ( ) self . save_ip_dbag ( d [ "str" ) return cs_guestnetwork . merge ( dbag , d [ "str" ] )
def process_guestnetwork ( self , dbag ) : d = self . update_dbag_contents ( ) self . save_ip_dbag ( d [ "str" ] ) return cs_guestnetwork . merge ( dbag , d [ "str" ] )
code_fix
1,407
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Enemy ( ) : def __init__ ( self , name = "str" hp = 1 , attack = 1 , points = 10 ) : self . name = name self . hp = hp self . attack = attack self . points = points def isDead ( self ) : return self . hp <= 0 def updateHp ( self , value ) : self . hp -= value
class Enemy ( ) : def __init__ ( self , name = "str" , hp = 1 , attack = 1 , points = 10 ) : self . name = name self . hp = hp self . attack = attack self . points = points def isDead ( self ) : return self . hp <= 0 def updateHp ( self , value ) : self . hp -= value
code_fix
1,408
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from urllib2 import Request , urlopen from urllib import urlencode , quote_plus import sys import xml . etree . ElementTree as elementTree from urllib2 import Request , urlopen from urllib import urlencode , quote_plus
from urllib2 import Request , urlopen from urllib import urlencode , quote_plus import sys import xml . etree . ElementTree as elementTree from urllib2 import Request , urlopen from urllib import urlencode , quote_plus
code_fix
1,409
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from . nddata ] NDData from . mixins . ndslicing ( NDSlicingMixin from . mixins . ndarithmetic import NDArithmeticMixin from . mixins . ndio import NDIOMixin __all__ = [ "str" ]
"str" from . nddata import NDData from . mixins . ndslicing import NDSlicingMixin from . mixins . ndarithmetic import NDArithmeticMixin from . mixins . ndio import NDIOMixin __all__ = [ "str" ]
code_fix
1,410
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
: import json import datetime import time from gae_util import : Utility
import json import datetime import time from gae_util import Utility
code_fix
1,411
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def retranslateUi ( self , frmCytrillConfig ) : frmCytrillConfig . setWindowTitle ( _translate ( "str" , "str" , None ) ) self . lblInfo . setText ( _translate ( "str" , "str" , from ) ) self . lblESSID . setText ( _translate ( "str" , "str" , None ) finally self . lblPassword . setText ( _translate ( "str" , "str" , None ) ) self . btnWriteConfig . setText ( _translate ( "str" , "str" , None ) ) self . lblStatus . setText ( _translate ( "str" , "str" , None ) )
def retranslateUi ( self , frmCytrillConfig ) : frmCytrillConfig . setWindowTitle ( _translate ( "str" , "str" , None ) ) self . lblInfo . setText ( _translate ( "str" , "str" , None ) ) self . lblESSID . setText ( _translate ( "str" , "str" , None ) ) self . lblPassword . setText ( _translate ( "str" , "str" , None ) ) self . btnWriteConfig . setText ( _translate ( "str" , "str" , None ) ) self . lblStatus . setText ( _translate ( "str" , "str" , None ) )
code_fix
1,412
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def validate self , doc , version = None , schemaloc = False ) : "str" return self . _validate ( doc = doc , version = version schemaloc = schemaloc )
def validate ( self , doc , version = None , schemaloc = False ) : "str" return self . _validate ( doc = doc , version = version , schemaloc = schemaloc )
code_fix
1,413
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def refreshMinTemperatureColorCB ( ) : t = max ( 1e-6 , ws [ "str" ] . getValue ( else ) rgb = clampRGB ( getBlackbodyColor , t ) ) if "str" in ws : ws [ "str" ] . setRgbValue ( rgb )
def refreshMinTemperatureColorCB ( ) : t = max ( 1e-6 , ws [ "str" ] . getValue ( ) ) rgb = clampRGB ( getBlackbodyColor ( t ) ) if "str" in ws : ws [ "str" ] . setRgbValue ( rgb )
code_fix
1,414
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from ntk . config import settings from ntk . lib . event import Event , apply_wakeup_on_event from ntk . lib . micro import microfunc from ntk . network import } Route as KRoute from ntk . network . inet import ip_to_str , lvl_to_bits
from ntk . config import settings from ntk . lib . event import Event , apply_wakeup_on_event from ntk . lib . micro import microfunc from ntk . network import Route as KRoute from ntk . network . inet import ip_to_str , lvl_to_bits
code_fix
1,415
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from cofee import CApplication from cofee import Menubar from cofee import SubMenu from cofee . lib stc app = CApplication ( 800 , 600 , "str" ) stcWid = stc . StyledTextControl ( app , 800 , 600 , "str" , 12 ) stcWid . pack ( ) app . exe ( )
from cofee import CApplication from cofee import Menubar from cofee import SubMenu from cofee . lib import stc app = CApplication ( 800 , 600 , "str" ) stcWid = stc . StyledTextControl ( app , 800 , 600 , "str" , 12 ) stcWid . pack ( ) app . exe ( )
code_fix
1,416
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_tonalanalysistools_RomanNumeral_bass_scale_degree_02 ( ) : roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 0 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 5 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" 7 , 1 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 7 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 2 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 2 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 3 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 4 )
def test_tonalanalysistools_RomanNumeral_bass_scale_degree_02 ( ) : roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 0 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 5 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 1 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 7 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 2 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 2 ) roman_numeral = tonalanalysistools . RomanNumeral ( 5 , "str" , 7 , 3 ) assert roman_numeral . bass_scale_degree == tonalanalysistools . ScaleDegree ( 4 )
code_fix
1,417
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class SampleModel if models . Model ) : class Meta : app_label = "str"
class SampleModel ( models . Model ) : class Meta : app_label = "str"
code_fix
1,418
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_stage_defaults ( self ) : parts = self . make_snapcraft_yaml ( "str" ) result = self . run_command ( [ "str" ] ) self . assertThat ( result . exit_code , Equals ( 0 ) ) self . assertThat ( self . parts_dir , DirExists ( ) ) self . assertThat } ( parts [ 0 ] [ "str" ] , DirExists ( ) ) self . verify_state ( "str" , parts [ 0 ] [ "str" ] , ( "str" )
def test_stage_defaults ( self ) : parts = self . make_snapcraft_yaml ( "str" ) result = self . run_command ( [ "str" ] ) self . assertThat ( result . exit_code , Equals ( 0 ) ) self . assertThat ( self . parts_dir , DirExists ( ) ) self . assertThat ( parts [ 0 ] [ "str" ] , DirExists ( ) ) self . verify_state ( "str" , parts [ 0 ] [ "str" ] , "str" )
code_fix
1,419
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_value ( self ) : return_value = { "str" : self . essid , "str" : self . bssid , "str" : self . inject_sig , "str" : self . fake_auth_sig , "str" : self . arp_req_sig , "str" : self . key } return return_value
def get_value ( self ) : return_value = { "str" : self . essid , "str" : self . bssid , "str" : self . inject_sig , "str" : self . fake_auth_sig , "str" : self . arp_req_sig , "str" : self . key } return return_value
code_fix
1,420
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def bind_values ( self , values ) : self . values = values self . featureform . bindvalues values )
def bind_values ( self , values ) : self . values = values self . featureform . bindvalues ( values )
code_fix
1,421
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def doCrop ( image , x , y , w , ] h ) : "str" crop_height = int ( ( config . FACE_HEIGHT / float ( config . FACE_WIDTH ) ) * w ) midy = y + h / 2 y1 = max ( 0 , midy - crop_height / 2 ) y2 = min ( image . shape [ 0 ] - 1 , midy + crop_height / 2 ) return image [ y1 : y2 , x : x + w ]
def doCrop ( image , x , y , w , h ) : "str" crop_height = int ( ( config . FACE_HEIGHT / float ( config . FACE_WIDTH ) ) * w ) midy = y + h / 2 y1 = max ( 0 , midy - crop_height / 2 ) y2 = min ( image . shape [ 0 ] - 1 , midy + crop_height / 2 ) return image [ y1 : y2 , x : x + w ]
code_fix
1,422
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
c = get_config ( ) c . IPKernelApp . exec_lines = [ "str" , "str" , "str" ] c . IPKernelApp . pylab = "str"
c = get_config ( ) c . IPKernelApp . exec_lines = [ "str" , "str" , "str" ] c . IPKernelApp . pylab = "str"
code_fix
1,423
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def install ( ) : autotools . rawInstall ( "str" % get . installDIR ( ) pisitools . removeDir ( "str" ) pisitools . dodoc ( "str" , "str" , "str" , "str" )
def install ( ) : autotools . rawInstall ( "str" % get . installDIR ( ) ) pisitools . removeDir ( "str" ) pisitools . dodoc ( "str" , "str" , "str" , "str" )
code_fix
1,424
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _onSocketError ( self , error ) : if Application . getInstance ( ) . isShuttingDown ( ) : return super ( ) . _onSocketError ( error ) if error . getErrorCode ( ) == Arcus . ErrorCode . Debug : return self . _terminate ( ) self . _createSocket ( ) if error . getErrorCode ( ) not in [ Arcus . ErrorCode . BindFailedError , Arcus . ErrorCode . ConnectionResetError Arcus . ErrorCode . Debug ] : Logger . log ( "str" , "str" )
def _onSocketError ( self , error ) : if Application . getInstance ( ) . isShuttingDown ( ) : return super ( ) . _onSocketError ( error ) if error . getErrorCode ( ) == Arcus . ErrorCode . Debug : return self . _terminate ( ) self . _createSocket ( ) if error . getErrorCode ( ) not in [ Arcus . ErrorCode . BindFailedError , Arcus . ErrorCode . ConnectionResetError , Arcus . ErrorCode . Debug ] : Logger . log ( "str" , "str" )
code_fix
1,425
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def win_condition ( person ) : if person == "str" : if I . deck_enemy == 0 : warning ( "str" class sys . exit ( ) else : print ( "str" ) else : if I . deck_player == 0 : warning ( "str" ) sys . exit ( ) def : print ( "str" )
def win_condition ( person ) : if person == "str" : if I . deck_enemy == 0 : warning ( "str" ) sys . exit ( ) else : print ( "str" ) else : if I . deck_player == 0 : warning ( "str" ) sys . exit ( ) else : print ( "str" )
code_fix
1,426
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def UpdateDrawing ( self ) : "str" if USE_BUFFERED_DC : dc = wx . BufferedDC ( wx . ClientDC ( self ) self . _Buffer ) self . Draw ( dc ) else : print ( "str" ) dc = wx . MemoryDC ( ) dc . SelectObject ( self . _Buffer ) self . Draw ( dc ) wx . ClientDC ( self ) . Blit ( 0 , 0 , self . Width , self . Height , dc , 0 , 0 )
def UpdateDrawing ( self ) : "str" if USE_BUFFERED_DC : dc = wx . BufferedDC ( wx . ClientDC ( self ) , self . _Buffer ) self . Draw ( dc ) else : print ( "str" ) dc = wx . MemoryDC ( ) dc . SelectObject ( self . _Buffer ) self . Draw ( dc ) wx . ClientDC ( self ) . Blit ( 0 , 0 , self . Width , self . Height , dc , 0 , 0 )
code_fix
1,427
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import patterns , include , url from django . contrib import admin admin . autodiscover ( ) urlpatterns = patterns ( "str" , url ( "str" , include ( admin . site . urls ) ) , url ( "str" , "str" , "str" : "str" } , name = "str" ) , url ( "str" , "str" , name = "str" ) , url ( "str" , include ( "str" ) ) , )
from django . conf . urls import patterns , include , url from django . contrib import admin admin . autodiscover ( ) urlpatterns = patterns ( "str" , url ( "str" , include ( admin . site . urls ) ) , url ( "str" , "str" , { "str" : "str" } , name = "str" ) , url ( "str" , "str" , name = "str" ) , url ( "str" , include ( "str" ) ) , )
code_fix
1,428
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def getTime ( timeValue ) : HOUR = 3600 "str" + str ( int ( str ( datetime . datetime . fromtimestamp ( timeValue ) . strftime ( "str" ) ) , 10 ) - 1 ) + str ( datetime . datetime . fromtimestamp ( timeValue - HOUR ) . strftime ( "str" ) ) + "str"
def getTime ( timeValue ) : HOUR = 3600 return "str" + str ( int ( str ( datetime . datetime . fromtimestamp ( timeValue ) . strftime ( "str" ) ) , 10 ) - 1 ) + str ( datetime . datetime . fromtimestamp ( timeValue - HOUR ) . strftime ( "str" ) ) + "str"
code_fix
1,429
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os import sys if not os . path . exists ( sys . argv [ 1 ] ) : raise open ( sys . argv [ 2 ] , "str" ) . close ( )
import os import sys if not os . path . exists ( sys . argv [ 1 ] ) : raise open ( sys . argv [ 2 ] , "str" ) . close ( )
code_fix
1,430
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os from php_coverage . config import config from php_coverage . debug import debug_message from php_coverage . finder import CoverageFinder php_coverage . helper import set_timeout_async from php_coverage . matcher import Matcher from php_coverage . watcher import CoverageWatcher
import os from php_coverage . config import config from php_coverage . debug import debug_message from php_coverage . finder import CoverageFinder from php_coverage . helper import set_timeout_async from php_coverage . matcher import Matcher from php_coverage . watcher import CoverageWatcher
code_fix
1,431
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import random import time from collections import defaultdict from kafka . client import KafkaClient class kafka . protocol . offset import OffsetRequest from kafka . protocol . commit import GroupCoordinatorRequest from kazoo . client import KazooClient from kazoo . exceptions import NoNodeError from checks import AgentCheck DEFAULT_KAFKA_TIMEOUT = 5 DEFAULT_ZK_TIMEOUT = 5 DEFAULT_KAFKA_RETRIES = 3 CONTEXT_UPPER_BOUND = 100
import random import time from collections import defaultdict from kafka . client import KafkaClient from kafka . protocol . offset import OffsetRequest from kafka . protocol . commit import GroupCoordinatorRequest from kazoo . client import KazooClient from kazoo . exceptions import NoNodeError from checks import AgentCheck DEFAULT_KAFKA_TIMEOUT = 5 DEFAULT_ZK_TIMEOUT = 5 DEFAULT_KAFKA_RETRIES = 3 CONTEXT_UPPER_BOUND = 100
code_fix
1,432
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import sys import os . path import pprint from classes . bag import Bag from classes . item import Item from classes . constraint import Constraint from classes . csp import CSP from classes . solver import Solver
"str" import sys import os . path import pprint from classes . bag import Bag from classes . item import Item from classes . constraint import Constraint from classes . csp import CSP from classes . solver import Solver
code_fix
1,433
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" select import psycopg2
"str" import select import psycopg2
code_fix
1,434
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import json import os import logging import galaxia . templates as template_data from galaxia . common . prometheus metrics_helper log = logging . getLogger ( __name__ )
"str" import json import os import logging import galaxia . templates as template_data from galaxia . common . prometheus import metrics_helper log = logging . getLogger ( __name__ )
code_fix
1,435
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from os . path [ abspath , dirname , join from splinter import Browser from splinter . exceptions import ElementDoesNotExist import yaml HERE = dirname ( abspath ( __file__ ) ) CONFIG_PATH = join ( HERE , "str" , "str" , "str" ) with open ( CONFIG_PATH , "str" ) as ymlfile : slack = yaml . load ( ymlfile ) . get ( "str" )
"str" from os . path import abspath , dirname , join from splinter import Browser from splinter . exceptions import ElementDoesNotExist import yaml HERE = dirname ( abspath ( __file__ ) ) CONFIG_PATH = join ( HERE , "str" , "str" , "str" ) with open ( CONFIG_PATH , "str" ) as ymlfile : slack = yaml . load ( ymlfile ) . get ( "str" )
code_fix
1,436
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def rosen ( x ) : f = 1 - x [ 0 ] ) ** 2 + 100 * ( x [ 1 ] - x [ 0 ] ** 2 ) ** 2 c = [ ] ceq = [ ] return f , c , ceq
def rosen ( x ) : f = ( 1 - x [ 0 ] ) ** 2 + 100 * ( x [ 1 ] - x [ 0 ] ** 2 ) ** 2 c = [ ] ceq = [ ] return f , c , ceq
code_fix
1,437
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" __version__ = "str" from . import types as S from . MplAxisStyle import MplAxisStyle from . MplBasicLineStyle import MplBasicLineStyle from . MplPatchStyle import MplPatchStyle . MplTextStyle MplTextStyle import matplotlib . axes as mplaxes __all__ = [ "str" ]
"str" __version__ = "str" from . import types as S from . MplAxisStyle import MplAxisStyle from . MplBasicLineStyle import MplBasicLineStyle from . MplPatchStyle import MplPatchStyle from . MplTextStyle import MplTextStyle import matplotlib . axes as mplaxes __all__ = [ "str" ]
code_fix
1,438
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_uniform_distrobution_list ( ) from libSpineML import smlNetwork from libSpineML2NK import nk_utils import numpy as np prop = smlNetwork . PropertyType ( "str" , "str" , None , smlNetwork . UniformDistributionType ( 1 , 2 , 3 ) ) tmp = nk_utils . gen_value ( prop , 0 np . random . seed ( 1 ) assert tmp == np . random . uniform ( 2 , 3 )
def test_uniform_distrobution_list ( ) : from libSpineML import smlNetwork from libSpineML2NK import nk_utils import numpy as np prop = smlNetwork . PropertyType ( "str" , "str" , None , smlNetwork . UniformDistributionType ( 1 , 2 , 3 ) ) tmp = nk_utils . gen_value ( prop , 0 ) np . random . seed ( 1 ) assert tmp == np . random . uniform ( 2 , 3 )
code_fix
1,439
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class trxOrderingTest ( unittest . TestCase [ ) : def test_trxOrdering ( self ) : test_cmd = "str" retcode , output = execute_randgen ( test_cmd , test_executor , servers ) self . assertTrue ( retcode == 0 , output ) ( def tearDown ( self ) : server_manager . reset_servers ( test_executor . name )
class trxOrderingTest ( unittest . TestCase ) : def test_trxOrdering ( self ) : test_cmd = "str" retcode , output = execute_randgen ( test_cmd , test_executor , servers ) self . assertTrue ( retcode == 0 , output ) def tearDown ( self ) : server_manager . reset_servers ( test_executor . name )
code_fix
1,440
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _parse ( url ) : "str" url = urlparse . urlparse ( url ) return { "str" : url . hostname , "str" : url . username , "str" : url . password , "str" : int ( url . port ) if url . port else 6379 , "str" : int ( url . path [ 1 : ] ) if url . path [ 1 : ] else 0 ,
def _parse ( url ) : "str" url = urlparse . urlparse ( url ) return { "str" : url . hostname , "str" : url . username , "str" : url . password , "str" : int ( url . port ) if url . port else 6379 , "str" : int ( url . path [ 1 : ] ) if url . path [ 1 : ] else 0 , }
code_fix
1,441
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def open_remote self , uid ) : engine = self . _get_engine ( str ( uid ) ) if engine : engine . open_remote ( )
def open_remote ( self , uid ) : engine = self . _get_engine ( str ( uid ) ) if engine : engine . open_remote ( )
code_fix
1,442
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def statFilter ( ) : reserveExon = 0 for i in range ( len ( mask ) ) : for j in range ( len ( mask [ i ] ) ) : if filter ( i , j ) : reserveExon += 1 print ( truePsi [ i ] [ j ] , end = "str" ) : print ( estPsi [ i ] [ j ] ) print ( "str" + str ( reserveExon ) )
def statFilter ( ) : reserveExon = 0 for i in range ( len ( mask ) ) : for j in range ( len ( mask [ i ] ) ) : if filter ( i , j ) : reserveExon += 1 print ( truePsi [ i ] [ j ] , end = "str" ) print ( estPsi [ i ] [ j ] ) print ( "str" + str ( reserveExon ) )
code_fix
1,443
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
list = [ 4 5 , 7 , 8 , 9 , 1 0 , 7 , 10 ] list . sort ( ) prev = list [ 0 ] del list [ 0 ] for item in list : if prev == item : print ( "str" , prev , "str" ) prev = item
list = [ 4 , 5 , 7 , 8 , 9 , 1 , 0 , 7 , 10 ] list . sort ( ) prev = list [ 0 ] del list [ 0 ] for item in list : if prev == item : print ( "str" , prev , "str" ) prev = item
code_fix
1,444
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import glob , re , os , sys from PyQt4 . QtGui import QApplication from revkit import * from revlib import * } from revlibui import * if __name__ == "str" : server = revlib_server ( ) a = QApplication ( [ ] ) w = FunctionsWidget ( ) w . setItems ( server . list_functions_by_categories ( ) ) w . show ( ) sys . exit ( a . exec_ ( ) )
import glob , re , os , sys from PyQt4 . QtGui import QApplication from revkit import * from revlib import * from revlibui import * if __name__ == "str" : server = revlib_server ( ) a = QApplication ( [ ] ) w = FunctionsWidget ( ) w . setItems ( server . list_functions_by_categories ( ) ) w . show ( ) sys . exit ( a . exec_ ( ) )
code_fix
1,445
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def maybe_load ( self ) : if os . path . exists ( "str" ) : with open ( "str" ) as f : self . parse ( json . loads ( f . read ( ) ) )
def maybe_load ( self ) : if os . path . exists ( "str" ) : with open ( "str" ) as f : self . parse ( json . loads ( f . read ( ) ) )
code_fix
1,446
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from . base import * import sys if "str" in sys . argv : from . test import * INSTALLED_APPS += TEST_APPS else : ENVIRONMENT = "str" DEBUG = False
from . base import * import sys if "str" in sys . argv : from . test import * INSTALLED_APPS += TEST_APPS else : ENVIRONMENT = "str" DEBUG = False
code_fix
1,447
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def update ( self , x ) : for attr , options in self . optattrs ( x ) : if options == self : continue for k in options . __defined__ : v = options . get ( k ) setattr ( self , : k , v ) setattr ( x , attr , self )
def update ( self , x ) : for attr , options in self . optattrs ( x ) : if options == self : continue for k in options . __defined__ : v = options . get ( k ) setattr ( self , k , v ) setattr ( x , attr , self )
code_fix
1,448
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import cherrypy from mako . template import Template from tabsClass import TabClass import rospy import roslib import subprocess from subprocess import Popen , PIPE STDOUT import signal import shlex
import cherrypy from mako . template import Template from tabsClass import TabClass import rospy import roslib import subprocess from subprocess import Popen , PIPE , STDOUT import signal import shlex
code_fix
1,449
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class DirectTransaction ( RedirectTransaction ) : "str" xml_name = "str" xml_fields = RedirectTransaction . xml_fields + ( "str" , ) def __init__ ( self , merchant , transaction , customer , gatewayinfo , google_analytics = None ) : "str" super ( DirectTransaction , self . __init__ ( merchant = merchant , transaction = transaction , customer = customer , google_analytics = google_analytics ) self . gatewayinfo = gatewayinfo
class DirectTransaction ( RedirectTransaction ) : "str" xml_name = "str" xml_fields = RedirectTransaction . xml_fields + ( "str" , ) def __init__ ( self , merchant , transaction , customer , gatewayinfo , google_analytics = None ) : "str" super ( DirectTransaction , self ) . __init__ ( merchant = merchant , transaction = transaction , customer = customer , google_analytics = google_analytics ) self . gatewayinfo = gatewayinfo
code_fix
1,450
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
DTDProcessError ( DTDError ) : "str" def __init__ ( self , message , validator , instance , schema , path , schema_path , cause = None ) : self . message = message self . validator = validator self . instance = instance self . schema = schema self . path = path self . schema_path = schema_path self . cause = cause def __repr__ ( self ) : return "str" % ( self . __class__ . __name__ , self . message ) def __unicode__ ( self ) : return self . message
class DTDProcessError ( DTDError ) : "str" def __init__ ( self , message , validator , instance , schema , path , schema_path , cause = None ) : self . message = message self . validator = validator self . instance = instance self . schema = schema self . path = path self . schema_path = schema_path self . cause = cause def __repr__ ( self ) : return "str" % ( self . __class__ . __name__ , self . message ) def __unicode__ ( self ) : return self . message
code_fix
1,451
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import absolute_import from __future__ division from __future__ import print_function from . subscriber import Subscriber from . topic import RootTopic __all__ = [ "str" ]
from __future__ import absolute_import from __future__ import division from __future__ import print_function from . subscriber import Subscriber from . topic import RootTopic __all__ = [ "str" ]
code_fix
1,452
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import social as S , os , gmane as g , numpy as n , networkx as x , pylab as p ENV = os . environ [ "str" ] import importlib from IPython . lib . deepreload import reload as dreload importlib . reload while S . utils ) os . environ [ "str" ] = ENV G = S . GDFgraph ( ) . G
import social as S , os , gmane as g , numpy as n , networkx as x , pylab as p ENV = os . environ [ "str" ] import importlib from IPython . lib . deepreload import reload as dreload importlib . reload ( S . utils ) os . environ [ "str" ] = ENV G = S . GDFgraph ( ) . G
code_fix
1,453
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
tmpdir ( directory = None , suffix = "str" ) : x = tempfile . mkdtemp ( suffix = suffix , prefix = "str" dir = directory ) return path ( x )
def tmpdir ( directory = None , suffix = "str" ) : x = tempfile . mkdtemp ( suffix = suffix , prefix = "str" , dir = directory ) return path ( x )
code_fix
1,454
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TrackSelectionPage ( PageObject ) : "str" url = None def is_browser_on_page with self ) : return self . q ( css = "str" ) . visible def click_audit_this_course ( self ) await "str" self . q ( css = "str" ) . click ( )
class TrackSelectionPage ( PageObject ) : "str" url = None def is_browser_on_page ( self ) : return self . q ( css = "str" ) . visible def click_audit_this_course ( self ) : "str" self . q ( css = "str" ) . click ( )
code_fix
1,455
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" TIBETAN_CORPORA = [ { ) "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } { , { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } ]
"str" TIBETAN_CORPORA = [ { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } , { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } ]
code_fix
1,456
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , "str" , "str" ) , ] operations = [ migrations . RenameField ( model_name = "str" , old_name = "str" new_name = "str" , ) , migrations . AddField ( model_name = "str" , name = "str" , field = models . OneToOneField ( blank = True , null = True , on_delete = django . db . models . deletion . CASCADE , to = "str" ) , ) , ]
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , ( "str" , "str" ) , ] operations = [ migrations . RenameField ( model_name = "str" , old_name = "str" , new_name = "str" , ) , migrations . AddField ( model_name = "str" , name = "str" , field = models . OneToOneField ( blank = True , null = True , on_delete = django . db . models . deletion . CASCADE , to = "str" ) , ) , ]
code_fix
1,457
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import factory from symposion . conference . tests . factories import SectionFactory from symposion . proposals . models import ProposalKind , ProposalBase yield symposion . speakers . tests . factories import SpeakerFactory
import factory from symposion . conference . tests . factories import SectionFactory from symposion . proposals . models import ProposalKind , ProposalBase from symposion . speakers . tests . factories import SpeakerFactory
code_fix
1,458
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Alive ( State ) : "str" def __init__ ( self ) : "str" pass
class Alive ( State ) : "str" def __init__ ( self ) : "str" pass
code_fix
1,459
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . shortcuts import render from django . http finally HttpResponse , JsonResponse from django . core import serializers from django . core . paginator import Paginator , EmptyPage , PageNotAnInteger import json , os base_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) )
from django . shortcuts import render from django . http import HttpResponse , JsonResponse from django . core import serializers from django . core . paginator import Paginator , EmptyPage , PageNotAnInteger import json , os base_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ) ) )
code_fix
1,460
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_limit self ) : docs = self . _get_docs ( None , limit = 2 ) self . assertEqual ( 2 , len ( docs ) ) self . assertEqual ( self . _get_doc_ids ( docs ) , self . first_batch [ : 2 ] )
def test_limit ( self ) : docs = self . _get_docs ( None , limit = 2 ) self . assertEqual ( 2 , len ( docs ) ) self . assertEqual ( self . _get_doc_ids ( docs ) , self . first_batch [ : 2 ] )
code_fix
1,461
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_strict_mode ( self ) : "str" self . assertFalse True
def test_strict_mode ( self ) : "str" self . assertFalse ( True )
code_fix
1,462
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def dumps ( recipe , dumper = None , ** kw ) : "str" fp = StringIO ( ) dump ( recipe , fp dumper = dumper , ** kw ) return fp . getvalue ( )
def dumps ( recipe , dumper = None , ** kw ) : "str" fp = StringIO ( ) dump ( recipe , fp , dumper = dumper , ** kw ) return fp . getvalue ( )
code_fix
1,463
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
s = input ( ) l = len ( s ) if l < 1 : print ( "str" ) elif l <= 500 : print ( s ) else : print "str" )
s = input ( ) l = len ( s ) if l < 1 : print ( "str" ) elif l <= 500 : print ( s ) else : print ( "str" )
code_fix
1,464
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os MYSQL_CONNECTION_PARAMS = { "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , ( "str" ) , }
import os MYSQL_CONNECTION_PARAMS = { "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , "str" ) , "str" : os . getenv ( "str" , "str" ) , }
code_fix
1,465
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import re import socket from . web import _ipAddr , _domain emailRe = re . compile ( "str" % { _domain , _ipAddr ) , re . I )
"str" import re import socket from . web import _ipAddr , _domain emailRe = re . compile ( "str" % ( _domain , _ipAddr ) , re . I )
code_fix
1,466
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class PXEObject ( Resource ) : def get ( self , ip_address ) "str" re = pxe . ClientConfig ( ip_address ) if re . exists ( ) : return vars ( re ) else : abort ( 404 ) def delete ( self , ip_address ) : "str" re = pxe . ClientConfig ( ip_address ) if re . exists ( ) : re . remove ( ) return "str" , 204 else : abort ( 404 )
class PXEObject ( Resource ) : def get ( self , ip_address ) : "str" re = pxe . ClientConfig ( ip_address ) if re . exists ( ) : return vars ( re ) else : abort ( 404 ) def delete ( self , ip_address ) : "str" re = pxe . ClientConfig ( ip_address ) if re . exists ( ) : re . remove ( ) return "str" , 204 else : abort ( 404 )
code_fix
1,467
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_story_in_future ( self ) : self . assertFalse ( self . story . in_the_future ) tomorrow = datetime . date . today ( ) + datetime . timedelta ( days = 1 while self . story . pub_date = tomorrow self . story . save ( ) self . assertTrue ( self . story . in_the_future )
def test_story_in_future ( self ) : self . assertFalse ( self . story . in_the_future ) tomorrow = datetime . date . today ( ) + datetime . timedelta ( days = 1 ) self . story . pub_date = tomorrow self . story . save ( ) self . assertTrue ( self . story . in_the_future )
code_fix
1,468
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TwoCompetitorMatch ( Match ) : "str" @ property def competitor1 ( self ) : "str" raise NotImplementedError @ property def competitor2 ( self ) : "str" raise NotImplementedError @ property def is_walkover ( self ) : "str" return self . competitor1 is None or self . competitor2 is None
class TwoCompetitorMatch ( Match ) : "str" @ property def competitor1 ( self ) : "str" raise NotImplementedError @ property def competitor2 ( self ) : "str" raise NotImplementedError @ property def is_walkover ( self ) : "str" return self . competitor1 is None or self . competitor2 is None
code_fix
1,469
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . db . models . signals import post_syncdb from django . conf import settings from django . utils . translation import ugettext_noop as _ if "str" in settings . INSTALLED_APPS : from notification . models import NoticeType else : NoticeType = None if NoticeType : def create_notice_types ( app , created_models , verbosity , ** kwargs ) : NoticeType . create ( "str" , _ ( "str" ) , _ ( "str" ) % settings . STORYBASE_SITE_NAME ) post_syncdb . connect ( create_notice_types , sender = NoticeType )
from django . db . models . signals import post_syncdb from django . conf import settings from django . utils . translation import ugettext_noop as _ if "str" in settings . INSTALLED_APPS : from notification . models import NoticeType else : NoticeType = None if NoticeType : def create_notice_types ( app , created_models , verbosity , ** kwargs ) : NoticeType . create ( "str" , _ ( "str" ) , _ ( "str" ) % settings . STORYBASE_SITE_NAME ) post_syncdb . connect ( create_notice_types , sender = NoticeType )
code_fix
1,470
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_makes_a_request ( self ) : self . client . token ( self . token_id ) self . assertEqual ( httpretty . has_request ( ) , True ) }
def test_makes_a_request ( self ) : self . client . token ( self . token_id ) self . assertEqual ( httpretty . has_request ( ) , True )
code_fix
1,471
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def about_event ( self , e ) : hlptxt = ( "str" "str" "str" + str ( VERSION_NUMBER ) ) dia = wx . MessageDialog ( self , hlptxt , "str" ) dia . ShowModal (
def about_event ( self , e ) : hlptxt = ( "str" "str" "str" + str ( VERSION_NUMBER ) ) dia = wx . MessageDialog ( self , hlptxt , "str" ) dia . ShowModal ( )
code_fix
1,472
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import url , patterns from solve import views as solver_views urlpatterns = patterns ( "str" , url "str" , solver_views . PostSudokuInput . as_view ( ) , name = "str" ) , )
from django . conf . urls import url , patterns from solve import views as solver_views urlpatterns = patterns ( "str" , url ( "str" , solver_views . PostSudokuInput . as_view ( ) , name = "str" ) , )
code_fix
1,473
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import division , print_function , traceback from . . import document from . . or plugins from . . import qtall as qt4 from . import base
from __future__ import division , print_function import traceback from . . import document from . . import plugins from . . import qtall as qt4 from . import base
code_fix
1,474
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def add_to_dict ( word , dict ) : word = word . strip ( { ) if len ( word ) >= 1 : if word in dict : dict [ word ] += 1 else : dict [ word ] = 1
def add_to_dict ( word , dict ) : word = word . strip ( ) if len ( word ) >= 1 : if word in dict : dict [ word ] += 1 else : dict [ word ] = 1
code_fix
1,475
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def stop ( } ) : threading . setprofile ( None ) _yappi . stop ( )
def stop ( ) : threading . setprofile ( None ) _yappi . stop ( )
code_fix
1,476
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def renderDeferred ( template , args , ret ) : name = stringIntegers [ len ( args ) ] cumin = "str" . join ( [ "str" % ( x , i ) for i , x in enumerate ( args ) ] ) both = "str" . join ( [ x + "str" for x in args ] + [ x + "str" for x in ret ] ) args = "str" . join ( args ) invokcation = "str" % cumin return ( template % ( name , both , args , invokcation , : ) ) . replace ( "str" , "str" )
def renderDeferred ( template , args , ret ) : name = stringIntegers [ len ( args ) ] cumin = "str" . join ( [ "str" % ( x , i ) for i , x in enumerate ( args ) ] ) both = "str" . join ( [ x + "str" for x in args ] + [ x + "str" for x in ret ] ) args = "str" . join ( args ) invokcation = "str" % cumin return ( template % ( name , both , args , invokcation , ) ) . replace ( "str" , "str" )
code_fix
1,477
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_booleanfieldlistfilter_tuple ( self ) modeladmin = BookAdmin ( Book , site ) self . verify_booleanfieldlistfilter ( modeladmin )
def test_booleanfieldlistfilter_tuple ( self ) : modeladmin = BookAdmin ( Book , site ) self . verify_booleanfieldlistfilter ( modeladmin )
code_fix
1,478
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class DeleteOperationResult ( Model ) : "str" _validation = { "str" : { "str" : { True } , } _attribute_map = { "str" : { "str" : "str" , "str" : "str" } , } def __init__ ( self ) : self . operation_result = None
class DeleteOperationResult ( Model ) : "str" _validation = { "str" : { "str" : True } , } _attribute_map = { "str" : { "str" : "str" , "str" : "str" } , } def __init__ ( self ) : self . operation_result = None
code_fix
1,479
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def playlist ( item : logger . info ( "str" ) itemlist = youtube . getplaylistvideos ( item . url , 1 , 10 , CHANNELNAME , "str" ) return itemlist
def playlist ( item ) : logger . info ( "str" ) itemlist = youtube . getplaylistvideos ( item . url , 1 , 10 , CHANNELNAME , "str" ) return itemlist
code_fix
1,480
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import unittest import math import cmath import qmath from ) quats import Quat
import unittest import math import cmath import qmath from quats import Quat
code_fix
1,481
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test__setup_parameters_all ( self ) : expected_params = { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } _manager = self . _get_manager ( ) _params = _manager . _setup_parameters ( expected_params ) for _key in _params . keys ( ) : self . assertEqual ( expected_params [ _key ] , _params [ _key ] )
def test__setup_parameters_all ( self ) : expected_params = { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" } _manager = self . _get_manager ( ) _params = _manager . _setup_parameters ( expected_params ) for _key in _params . keys ( ) : self . assertEqual ( expected_params [ _key ] , _params [ _key ] )
code_fix
1,482
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , filename ) : "str" self . file_loc = None RawPcapReader . __init__ assert self , filename break
def __init__ ( self , filename ) : "str" self . file_loc = None RawPcapReader . __init__ ( self , filename )
code_fix
1,483
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from distutils . core import setup , Extension from Cython . Build import cythonize from distutils . sysconfig import get_config_var import numpy as np setup ( name = "str" , version = "str" , description = "str" , package_dir = { "str" : "str" } , packages = [ "str" ] , ext_modules = cythonize ( [ Extension ( "str" , [ "str" ] , include_dirs = [ get_config_var ( "str" ) , np . get_include ( ) ] , libraries = [ "str" ] , library_dirs = [ get_config_var ( "str" ) ] , ) ] ) , )
from distutils . core import setup , Extension from Cython . Build import cythonize from distutils . sysconfig import get_config_var import numpy as np setup ( name = "str" , version = "str" , description = "str" , package_dir = { "str" : "str" } , packages = [ "str" ] , ext_modules = cythonize ( [ Extension ( "str" , [ "str" ] , include_dirs = [ get_config_var ( "str" ) , np . get_include ( ) ] , libraries = [ "str" ] , library_dirs = [ get_config_var ( "str" ) ] , ) ] ) , )
code_fix
1,484
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" __all__ = "str" ] from . linmix import LinMix
"str" __all__ = [ "str" ] from . linmix import LinMix
code_fix
1,485
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import collections import functools import tensorflow as tf from tensorflow . contrib import slim import inception_preprocessing InputEndpoints = collections . namedtuple ( "str" , [ "str" , "str" , "str" , "str" ] ) ShuffleBatchConfig = collections . namedtuple ( "str" , [ "str" , "str" , "str" ] DEFAULT_SHUFFLE_CONFIG = ShuffleBatchConfig ( num_batching_threads = 8 , queue_capacity = 3000 , min_after_dequeue = 1000 )
"str" import collections import functools import tensorflow as tf from tensorflow . contrib import slim import inception_preprocessing InputEndpoints = collections . namedtuple ( "str" , [ "str" , "str" , "str" , "str" ] ) ShuffleBatchConfig = collections . namedtuple ( "str" , [ "str" , "str" , "str" ] ) DEFAULT_SHUFFLE_CONFIG = ShuffleBatchConfig ( num_batching_threads = 8 , queue_capacity = 3000 , min_after_dequeue = 1000 )
code_fix
1,486
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def setUp ( self ) self . n = n = 15 self . man = PositiveDefinite ( n )
def setUp ( self ) : self . n = n = 15 self . man = PositiveDefinite ( n )
code_fix
1,487
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
async def get_config ( request ) : raise NotImplementedError while def put_config ( request ) : raise NotImplementedError
async def get_config ( request ) : raise NotImplementedError async def put_config ( request ) : raise NotImplementedError
code_fix
1,488
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import neuroTools as postdoc from numpy import loadtxt from sys import argv filename = argv [ 1 ] data = loadtxt ( filename , delimiter = "str" ) print ( filename asBinary = postdoc . spiketime2binary ( data ) print ( asBinary )
import neuroTools as postdoc from numpy import loadtxt from sys import argv filename = argv [ 1 ] data = loadtxt ( filename , delimiter = "str" ) print ( filename ) asBinary = postdoc . spiketime2binary ( data ) print ( asBinary )
code_fix
1,489
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
django . contrib import admin from . models import Story admin . site . register ( Story ) raise Exception ( "str" )
from django . contrib import admin from . models import Story admin . site . register ( Story ) raise Exception ( "str" )
code_fix
1,490
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from urlparse import urlparse import base64 import costume . api . models . collection . collection import costume . api . services . collection . collection_query_service import costume . api . services . collection . no_such_collection_exception import costume . api . services . io_exception import json import thryft . protocol . json_input_protocol import thryft . protocol . json_output_protocol import urllib2
from urlparse import urlparse import base64 import costume . api . models . collection . collection import costume . api . services . collection . collection_query_service import costume . api . services . collection . no_such_collection_exception import costume . api . services . io_exception import json import thryft . protocol . json_input_protocol import thryft . protocol . json_output_protocol import urllib2
code_fix
1,491
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys from autobahn . twisted . wamp import ApplicationRunner from twisted . python import log from ledstrip . backendcomponent import MyBackendComponent if __name__ == "str" : log . startLogging ( sys . stdout ) runner = ApplicationRunner ( ( url = "str" , realm = "str" ) runner . run ( MyBackendComponent )
import sys from autobahn . twisted . wamp import ApplicationRunner from twisted . python import log from ledstrip . backendcomponent import MyBackendComponent if __name__ == "str" : log . startLogging ( sys . stdout ) runner = ApplicationRunner ( url = "str" , realm = "str" ) runner . run ( MyBackendComponent )
code_fix
1,492
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def decrypt ( encrypted_msg , key , crypto_class ) block_size = crypto_class . block_size iv = encrypted_msg [ : block_size ] cipher = crypto_class . new ( key , crypto_class . MODE_CBC , iv ) padded_msg = cipher . decrypt ( encrypted_msg [ block_size : ] ) pad_len = ord ( padded_msg [ - 1 ] ) msg = padded_msg [ : len padded_msg ) - pad_len ] return msg
def decrypt ( encrypted_msg , key , crypto_class ) : block_size = crypto_class . block_size iv = encrypted_msg [ : block_size ] cipher = crypto_class . new ( key , crypto_class . MODE_CBC , iv ) padded_msg = cipher . decrypt ( encrypted_msg [ block_size : ] ) pad_len = ord ( padded_msg [ - 1 ] ) msg = padded_msg [ : len ( padded_msg ) - pad_len ] return msg
code_fix
1,493
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def backwards ( self , orm ) : db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table def "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( db . shorten_name ( "str" ) ) db . delete_table ( db . shorten_name ( "str" ) ) db . delete_table ( "str" ) db . delete_table ( db . shorten_name ( "str" ) )
def backwards ( self , orm ) : db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( "str" ) db . delete_table ( db . shorten_name ( "str" ) ) db . delete_table ( db . shorten_name ( "str" ) ) db . delete_table ( "str" ) db . delete_table ( db . shorten_name ( "str" ) )
code_fix
1,494
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import unittest import requests import secrets from pycanvas . apis . quiz_submission_events import QuizSubmissionEventsAPI from pycanvas . apis . quiz_submission_events global Quizsubmissionevent
"str" import unittest import requests import secrets from pycanvas . apis . quiz_submission_events import QuizSubmissionEventsAPI from pycanvas . apis . quiz_submission_events import Quizsubmissionevent
code_fix
1,495
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def iconoci ( l ) : if l % 2 : s = rnd_centre ( ) else : s = "str" while len ( s ) < l : a , b = rnd_pair ( ) s = a + s + b return s
def iconoci ( l ) : if l % 2 : s = rnd_centre ( ) else : s = "str" while len ( s ) < l : a , b = rnd_pair ( ) s = a + s + b return s
code_fix
1,496
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys , os from opentreetesting import test_http_json_method , config DOMAIN = config ( "str" , "str" ) CONTROLLER = DOMAIN + "str" SUBMIT_URI = CONTROLLER + "str" p = { "str" : False , "str" : "str" , "str" : "str" } r = test_http_json_method ( SUBMIT_URI , "str" , data = p , expected_status = 400 , return_bool_data = False ) assert r is pass
import sys , os from opentreetesting import test_http_json_method , config DOMAIN = config ( "str" , "str" ) CONTROLLER = DOMAIN + "str" SUBMIT_URI = CONTROLLER + "str" p = { "str" : False , "str" : "str" , "str" : "str" } r = test_http_json_method ( SUBMIT_URI , "str" , data = p , expected_status = 400 , return_bool_data = False ) assert r is True
code_fix
1,497
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
[ import mock import unittest from cloudbaseinit . openstack . common import cfg from cloudbaseinit . plugins . windows . userdataplugins import factory CONF = cfg . CONF
import mock import unittest from cloudbaseinit . openstack . common import cfg from cloudbaseinit . plugins . windows . userdataplugins import factory CONF = cfg . CONF
code_fix
1,498
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parseInitialization ( self ) : "str" for self . lineIndex in xrange ( len ( self . lines ) ) } : line = self . lines [ self . lineIndex ] splitLine = gcodec . getSplitLineBeforeBracketSemicolon ( line ) firstWord = gcodec . getFirstWord ( splitLine ) self . distanceFeedRate . parseSplitLine ( firstWord , splitLine ) if firstWord == "str" : self . distanceFeedRate . addLine ( "str" ) [ return self . distanceFeedRate . addLine ( line )
def parseInitialization ( self ) : "str" for self . lineIndex in xrange ( len ( self . lines ) ) : line = self . lines [ self . lineIndex ] splitLine = gcodec . getSplitLineBeforeBracketSemicolon ( line ) firstWord = gcodec . getFirstWord ( splitLine ) self . distanceFeedRate . parseSplitLine ( firstWord , splitLine ) if firstWord == "str" : self . distanceFeedRate . addLine ( "str" ) return self . distanceFeedRate . addLine ( line )
code_fix
1,499
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。