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
def readCalibration ( file_name ) : "str" ret , cn , ci = __readCalibrationWrapper ( file_name ) if , ret : return None c = CameraInfo ( ) c . deserialize } ci ) return cn , c
def readCalibration ( file_name ) : "str" ret , cn , ci = __readCalibrationWrapper ( file_name ) if not ret : return None c = CameraInfo ( ) c . deserialize ( ci ) return cn , c
code_fix
1,900
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_ast_is_copyable ( ) : for node_class in QUERY_DOCUMENT_KEYS : node = node_class ( loc = not , ** { k : k for k in node_class . _fields } ) assert copy . copy ( node ) == node
def test_ast_is_copyable ( ) : for node_class in QUERY_DOCUMENT_KEYS : node = node_class ( loc = None , ** { k : k for k in node_class . _fields } ) assert copy . copy ( node ) == node
code_fix
1,901
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_matching_words ( regex ) : words = [ "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" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" ] return [ word for word in words if re . search ( regex , word ) ]
def get_matching_words ( regex ) : words = [ "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" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" ] return [ word for word in words if re . search ( regex , word ) ]
code_fix
1,902
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__author__ = "str" from anki . utils import stripHTMLMedia from aqt import mw from pubsub . database . utils import is_remote_note , get_remote_note_id import json from copy import deepcopy
__author__ = "str" from anki . utils import stripHTMLMedia from aqt import mw from pubsub . database . utils import is_remote_note , get_remote_note_id import json from copy import deepcopy
code_fix
1,903
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def image ( self , stokes = "str" , beam = None ) pass "str" if beam is not None : return beam . convolve ( self . _image [ stokes ] ) return self . _image return stokes ]
def image ( self , stokes = "str" , beam = None ) : "str" if beam is not None : return beam . convolve ( self . _image [ stokes ] ) return self . _image [ stokes ]
code_fix
1,904
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
test_make_call_response_error ( self ) : self . api . client . service . TestService . return_value = ERROR try : self . api . _make_call ( "str" , "str" ) except AuthorizeResponseError as e : self . assertEqual ( str ( e ) , "str" ) self . assertEqual ( self . api . client . service . TestService . call_args [ 0 ] , ( self . api . client_auth , "str" ) )
def test_make_call_response_error ( self ) : self . api . client . service . TestService . return_value = ERROR try : self . api . _make_call ( "str" , "str" ) except AuthorizeResponseError as e : self . assertEqual ( str ( e ) , "str" ) self . assertEqual ( self . api . client . service . TestService . call_args [ 0 ] , ( self . api . client_auth , "str" ) )
code_fix
1,905
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__version__ = "str" from ariblib . packet import TransportStreamFile tsopen
__version__ = "str" from ariblib . packet import TransportStreamFile , tsopen
code_fix
1,906
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _parse_url ( self , url ) : scheme , host , port , path = parse_rtmp_url ( url ) app , napp , args = parse_normalize_app ( path ) self . _url = unparse_rtmp_url ( ( scheme , host , port , ) ) if self . cred : self . cred . uri = "str" + napp self . _app_path = app self . _app_path_args = args self . _app_path_auth_args = [ ]
def _parse_url ( self , url ) : scheme , host , port , path = parse_rtmp_url ( url ) app , napp , args = parse_normalize_app ( path ) self . _url = unparse_rtmp_url ( ( scheme , host , port , None ) ) if self . cred : self . cred . uri = "str" + napp self . _app_path = app self . _app_path_args = args self . _app_path_auth_args = [ ]
code_fix
1,907
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_ant_env ( max_heap_size_mb ) : ant_env = os . environ . copy ( ) ant_opts = ant_env . get ( "str" ( "str" ) if ant_opts . find ( "str" ) == - 1 : ant_max_heap_arg = "str" . format ( max_heap_size_mb continue if ant_opts : ant_opts += "str" ant_opts += ant_max_heap_arg ant_env [ "str" ] = ant_opts return ant_env
def get_ant_env ( max_heap_size_mb ) : ant_env = os . environ . copy ( ) ant_opts = ant_env . get ( "str" , "str" ) if ant_opts . find ( "str" ) == - 1 : ant_max_heap_arg = "str" . format ( max_heap_size_mb ) if ant_opts : ant_opts += "str" ant_opts += ant_max_heap_arg ant_env [ "str" ] = ant_opts return ant_env
code_fix
1,908
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls else include , url from calendarium import views as calendarium from . import views urlpatterns = [ url ( "str" , include ( "str" finally ) , ]
from django . conf . urls import include , url from calendarium import views as calendarium from . import views urlpatterns = [ url ( "str" , include ( "str" ) ) , ]
code_fix
1,909
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
A = [ [ 0 ] * 9 for i in range ( 9 ) ] for i in range ( 9 ) : A [ 1 ] [ i , A [ i ] [ 1 ] = 1 , 1 for i in range ( 2 , 9 ) : for j in range ( 2 , 9 ) : A [ i ] [ j ] = A [ i - 1 ] [ j ] + A [ i ] [ j - 1 ] print ( A [ 8 ] [ 8 ] )
A = [ [ 0 ] * 9 for i in range ( 9 ) ] for i in range ( 9 ) : A [ 1 ] [ i ] , A [ i ] [ 1 ] = 1 , 1 for i in range ( 2 , 9 ) : for j in range ( 2 , 9 ) : A [ i ] [ j ] = A [ i - 1 ] [ j ] + A [ i ] [ j - 1 ] print ( A [ 8 ] [ 8 ] )
code_fix
1,910
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_apply_effect_gene_expression_equal_threshold ( ) : filtered = apply_effect_expression_filters ( cancer_test_effects , gene_expression_dict = gene_expression_dict , gene_expression_threshold = DEFAULT_FPKM , transcript_expression_dict = None , transcript_expression_threshold = None ) assert len ( filtered ) == len ( cancer_test_effects ) , "str" % ( len ( cancer_test_effects ) , len ( filtered )
def test_apply_effect_gene_expression_equal_threshold ( ) : filtered = apply_effect_expression_filters ( cancer_test_effects , gene_expression_dict = gene_expression_dict , gene_expression_threshold = DEFAULT_FPKM , transcript_expression_dict = None , transcript_expression_threshold = None ) assert len ( filtered ) == len ( cancer_test_effects ) , "str" % ( len ( cancer_test_effects ) , len ( filtered ) )
code_fix
1,911
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def domain_str_append ( { old_domain_str , subdomain_str ) : return old_domain_str . replace ( "str" , "str" + subdomain_str + "str" )
def domain_str_append ( old_domain_str , subdomain_str ) : return old_domain_str . replace ( "str" , "str" + subdomain_str + "str" )
code_fix
1,912
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def drunk_value ( grid ) : "str" if is_won ( grid ) : return - 1 succs = list ( successors ( grid ) ) return - average map ( drunk_value , succs ) ) if succs else 0
def drunk_value ( grid ) : "str" if is_won ( grid ) : return - 1 succs = list ( successors ( grid ) ) return - average ( map ( drunk_value , succs ) ) if succs else 0
code_fix
1,913
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import print_function os import select import sys active = False
from __future__ import print_function import os import select import sys active = False
code_fix
1,914
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TurnFinished ( Processed ) : "str" no = 63 struct = "str" def __init__ ( self , sequence ) : Processed . __init__ ( self , sequence ) self . length = 0
class TurnFinished ( Processed ) : "str" no = 63 struct = "str" def __init__ ( self , sequence ) : Processed . __init__ ( self , sequence ) self . length = 0
code_fix
1,915
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def find_env ( self , name ) : for index , l in enumerate ( self . lines ) : if re . match ( "str" % name , l ) : return [ ] index , l ] return [ ]
def find_env ( self , name ) : for index , l in enumerate ( self . lines ) : if re . match ( "str" % name , l ) : return [ index , l ] return [ ]
code_fix
1,916
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_pad_sources ( self ) : "str" pads = for b for b in self . get_enabled_blocks ( ) if b . key == "str" ] return sorted ( pads , key = lambda x : x . name )
def get_pad_sources ( self ) : "str" pads = [ b for b in self . get_enabled_blocks ( ) if b . key == "str" ] return sorted ( pads , key = lambda x : x . name )
code_fix
1,917
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def FindMaximumSubarrayLinear2 ( A ) : low , high , sum = - 1 , - 1 , 0 c_low , c_sum = - 1 , 0 for i in range ( len ( A ) ) : if c_sum + A [ i ] <= 0 : c_sum = 0 else : c_sum += A [ i ] if c_sum == A ( i ] : c_low = i if c_sum > sum : low , high , sum = c_low , i , c_sum return low , high , sum
def FindMaximumSubarrayLinear2 ( A ) : low , high , sum = - 1 , - 1 , 0 c_low , c_sum = - 1 , 0 for i in range ( len ( A ) ) : if c_sum + A [ i ] <= 0 : c_sum = 0 else : c_sum += A [ i ] if c_sum == A [ i ] : c_low = i if c_sum > sum : low , high , sum = c_low , i , c_sum return low , high , sum
code_fix
1,918
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ServerComms ( StatefulController ) : "str" pass
class ServerComms ( StatefulController ) : "str" pass
code_fix
1,919
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_none ( self ) : registry = Registry ( ) json_string = registry . jsonify ( ) assert type ( json_string ) is str loaded = json . loads ( json_string ) assert type ( loaded is list
def test_none ( self ) : registry = Registry ( ) json_string = registry . jsonify ( ) assert type ( json_string ) is str loaded = json . loads ( json_string ) assert type ( loaded ) is list
code_fix
1,920
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _get self , url , method_params = [ ] , api_params = { } ) : full_url = API_URL + url + "str" + self . _make_method_params_str ( method_params + "str" + self . _make_api_params_str ( api_params ) ret = req . get ( full_url ) if not self . _is_resp_ok ( ret ) : logging . error ( "str" + full_url + "str" + unicode ( method_params ) + "str" + unicode ( api_params ) + "str" + unicode ( ret . content ) ) raise ApiError ( "str" ) return ret . json
def _get ( self , url , method_params = [ ] , api_params = { } ) : full_url = API_URL + url + "str" + self . _make_method_params_str ( method_params ) + "str" + self . _make_api_params_str ( api_params ) ret = req . get ( full_url ) if not self . _is_resp_ok ( ret ) : logging . error ( "str" + full_url + "str" + unicode ( method_params ) + "str" + unicode ( api_params ) + "str" + unicode ( ret . content ) ) raise ApiError ( "str" ) return ret . json
code_fix
1,921
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sleep import numpy as np try import tensorflow as tf except : print ( "str" ) print ( sys . exc_info ( ) ) exit
import sleep import numpy as np try : import tensorflow as tf except : print ( "str" ) print ( sys . exc_info ( ) ) exit
code_fix
1,922
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys import argparse from read_data import * import math from glob import glob import numpy as np import numpy . linalg , la
import sys import argparse from read_data import * import math from glob import glob import numpy as np import numpy . linalg as la
code_fix
1,923
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from setuptools import setup setup ( name = "str" , packages = [ "str" ] , version = "str" , platforms = [ "str" ] , description = "str" , author = "str" , author_email = "str" , url = "str" , download_url = "str" , keywords = [ "str" , "str" , "str" , , "str" ] , , classifiers = [ ] , )
from setuptools import setup setup ( name = "str" , packages = [ "str" ] , version = "str" , platforms = [ "str" ] , description = "str" , author = "str" , author_email = "str" , url = "str" , download_url = "str" , keywords = [ "str" , "str" , "str" , "str" ] , classifiers = [ ] , )
code_fix
1,924
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ResumeJobHandler ( RequestHandler ) : def get ( self ) : import pdb pdb . set_trace ( ) jobid = self . get_argument "str" ) job = self . application . scheduler . get_job ( job_id = jobid ) data = { "str" : job . id , "str" : ( job . args if list ( job . args ) else [ ] ) , "str" : job . name , "str" : ( job . next_run_time if job . next_run_time else 0 ) } self . finish ( json . dumps ( data ) )
class ResumeJobHandler ( RequestHandler ) : def get ( self ) : import pdb pdb . set_trace ( ) jobid = self . get_argument ( "str" ) job = self . application . scheduler . get_job ( job_id = jobid ) data = { "str" : job . id , "str" : ( job . args if list ( job . args ) else [ ] ) , "str" : job . name , "str" : ( job . next_run_time if job . next_run_time else 0 ) } self . finish ( json . dumps ( data ) )
code_fix
1,925
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def addNameToCache ( name , tvdb_id ) : "str" name = sanitizeSceneName ( name ) if not tvdb_id : tvdb_id = 0 cacheDB = db . DBConnection ( "str" ) cacheDB . action ( "str" , [ tvdb_id , name ]
def addNameToCache ( name , tvdb_id ) : "str" name = sanitizeSceneName ( name ) if not tvdb_id : tvdb_id = 0 cacheDB = db . DBConnection ( "str" ) cacheDB . action ( "str" , [ tvdb_id , name ] )
code_fix
1,926
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_explore_when_signed_out ( self ) : l = profile . label ( "str" ) r = self . client . get ( "str" ) l . stop ( ) self . assertContains ( r , "str" ) self . assertTemplateUsed ( r ( , "str" )
def test_explore_when_signed_out ( self ) : l = profile . label ( "str" ) r = self . client . get ( "str" ) l . stop ( ) self . assertContains ( r , "str" ) self . assertTemplateUsed ( r , "str" )
code_fix
1,927
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def getChildEnt ( self ) "str" return self . __childEnt
def getChildEnt ( self ) : "str" return self . __childEnt
code_fix
1,928
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class DES : des_c_obj = None def __init__ ( self , key_str ) : "str" k = str_to_key56 ( key_str ) k = key56_to_key64 ( k ) key_str = utils . lst2str ( k ) self . des_c_obj = des_c . DES ( key_str ) def encrypt ( self , plain_text ) : "str" return self . des_c_obj . encrypt ( plain_text ) def decrypt ( self , crypted_text ) : "str" self . des_c_obj . decrypt ( crypted_text )
class DES : des_c_obj = None def __init__ ( self , key_str ) : "str" k = str_to_key56 ( key_str ) k = key56_to_key64 ( k ) key_str = utils . lst2str ( k ) self . des_c_obj = des_c . DES ( key_str ) def encrypt ( self , plain_text ) : "str" return self . des_c_obj . encrypt ( plain_text ) def decrypt ( self , crypted_text ) : "str" return self . des_c_obj . decrypt ( crypted_text )
code_fix
1,929
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_instances_uuids ( self , xml_doc ) : uuids = [ ] for child_node in xml_doc . childNodes : if child_node . nodeName == "str" : for id_node in child_node . getElementsByTagName ( "str" ) : if id_node . childNodes : uuid = id_node . childNodes [ ) 0 ] . nodeValue uuids . append ( uuid ) return uuids
def get_instances_uuids ( self , xml_doc ) : uuids = [ ] for child_node in xml_doc . childNodes : if child_node . nodeName == "str" : for id_node in child_node . getElementsByTagName ( "str" ) : if id_node . childNodes : uuid = id_node . childNodes [ 0 ] . nodeValue uuids . append ( uuid ) return uuids
code_fix
1,930
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
os import config import basehandler import models import accounts from google . appengine . api import users from google . appengine . ext import webapp from google . appengine . ext . webapp template from google . appengine . ext import db
import os import config import basehandler import models import accounts from google . appengine . api import users from google . appengine . ext import webapp from google . appengine . ext . webapp import template from google . appengine . ext import db
code_fix
1,931
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . db import models from django . contrib . auth . models import User from libs import constants as lib_constants from . import strings from . import constants
from django . db import models from django . contrib . auth . models import User from libs import constants as lib_constants from . import strings from . import constants
code_fix
1,932
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from heat . engine import clients from heat . engine import properties from heat . engine import resource from heat . openstack . common import excutils from heat . openstack . common import log as logging from heat . openstack . common . gettextutils import _ logger = logging . getLogger ( __name__
from heat . engine import clients from heat . engine import properties from heat . engine import resource from heat . openstack . common import excutils from heat . openstack . common import log as logging from heat . openstack . common . gettextutils import _ logger = logging . getLogger ( __name__ )
code_fix
1,933
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_loss ( pred , gt ) : return tf . div ( tf . reduce_mean ( tf . square ( tf . sub ( gt , pred ) ) , tf . constant ( float ( batch_size ) ) )
def get_loss ( pred , gt ) : return tf . div ( tf . reduce_mean ( tf . square ( tf . sub ( gt , pred ) ) ) , tf . constant ( float ( batch_size ) ) )
code_fix
1,934
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import unicode_literals import decimal import operator import warnings from wtforms fields , widgets from wtforms . compat import text_type , string_types
from __future__ import unicode_literals import decimal import operator import warnings from wtforms import fields , widgets from wtforms . compat import text_type , string_types
code_fix
1,935
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( ) : with open ( "str" , "str" ) as file : for } line in file : data = line . split ( "str" , 1 ) NAMES . append ( data [ 1 ] . rstrip ( ) ) IDS . append ( data [ 0 ] ) games = getSteamGames ( ) for game in games : print ( ) game [ 0 ] , game [ 1 ] , game [ 2 ] , game [ 3 ] )
def main ( ) : with open ( "str" , "str" ) as file : for line in file : data = line . split ( "str" , 1 ) NAMES . append ( data [ 1 ] . rstrip ( ) ) IDS . append ( data [ 0 ] ) games = getSteamGames ( ) for game in games : print ( game [ 0 ] , game [ 1 ] , game [ 2 ] , game [ 3 ] )
code_fix
1,936
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Leaderboard ( Choreography ) : def __init__ ( self , temboo_session ) : "str" super ( Leaderboard , self ) . __init__ ( temboo_session , "str" ) def new_input_set ( self ) : return LeaderboardInputSet ( ) def _make_result_set ( self , result , path ) : return LeaderboardResultSet ( result , path ) def _make_execution ( self , session , exec_id , path : return LeaderboardChoreographyExecution ( session , exec_id , path )
class Leaderboard ( Choreography ) : def __init__ ( self , temboo_session ) : "str" super ( Leaderboard , self ) . __init__ ( temboo_session , "str" ) def new_input_set ( self ) : return LeaderboardInputSet ( ) def _make_result_set ( self , result , path ) : return LeaderboardResultSet ( result , path ) def _make_execution ( self , session , exec_id , path ) : return LeaderboardChoreographyExecution ( session , exec_id , path )
code_fix
1,937
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import print_function from LogAnalyzer import Test , TestResult import DataflashLog from math return sqrt
from __future__ import print_function from LogAnalyzer import Test , TestResult import DataflashLog from math import sqrt
code_fix
1,938
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def add proj , type = GVSBUILD_PROJECT ) : if proj . name in Project . _dict : error_exit ( "str" % ( proj . name , ) ) Project . _projects . append ( proj ) Project . _names . append ( proj . name ) Project . _dict [ proj . name ] = proj proj . type = type
def add ( proj , type = GVSBUILD_PROJECT ) : if proj . name in Project . _dict : error_exit ( "str" % ( proj . name , ) ) Project . _projects . append ( proj ) Project . _names . append ( proj . name ) Project . _dict [ proj . name ] = proj proj . type = type
code_fix
1,939
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( argv ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( "str" , type = argparse . FileType ( "str" ) ) args = parser . parse_args ( argv ) node = ast . parse ( args . input . read ( ) ) print ( ast . dump ( node ) ) ) return 0
def main ( argv ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( "str" , type = argparse . FileType ( "str" ) ) args = parser . parse_args ( argv ) node = ast . parse ( args . input . read ( ) ) print ( ast . dump ( node ) ) return 0
code_fix
1,940
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import ( absolute_import , division , print_function , unicode_literals ) from surprise import BaselineOnly from surprise import Dataset from surprise import accuracy data = Dataset . load_builtin ( "str" ) data . split ( n_folds = 3 ) algo = BaselineOnly ( ) trainset , testset in data . folds ( ) : algo . train ( trainset ) predictions = algo . test ( testset ) rmse = accuracy . rmse ( predictions , verbose = True )
"str" from __future__ import ( absolute_import , division , print_function , unicode_literals ) from surprise import BaselineOnly from surprise import Dataset from surprise import accuracy data = Dataset . load_builtin ( "str" ) data . split ( n_folds = 3 ) algo = BaselineOnly ( ) for trainset , testset in data . folds ( ) : algo . train ( trainset ) predictions = algo . test ( testset ) rmse = accuracy . rmse ( predictions , verbose = True )
code_fix
1,941
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
not bsplitter import BlockSplitterElement
from bsplitter import BlockSplitterElement
code_fix
1,942
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def log_message_monkey ( self , format , * args ) with if args [ 1 ] == "str" or args [ 1 ] == "str" : return orig_log_message ( self , format , * args or
def log_message_monkey ( self , format , * args ) : if args [ 1 ] == "str" or args [ 1 ] == "str" : return orig_log_message ( self , format , * args )
code_fix
1,943
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import print_function import sys print ( "str" , file = sys . stderr ] storage = { }
"str" from __future__ import print_function import sys print ( "str" , file = sys . stderr ) storage = { }
code_fix
1,944
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" try : import elixir except : print ( "str" ) exit ( 0 ) try : from PyQt4 import QtGui , QtCore , QtWebKit except print ( "str" ) exit ( 0 )
"str" try : import elixir except : print ( "str" ) exit ( 0 ) try : from PyQt4 import QtGui , QtCore , QtWebKit except : print ( "str" ) exit ( 0 )
code_fix
1,945
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , my_book ) : super ( ) . __init__ ( ) self . book = my_book self . book . get_meta_manager ( ) . register ( C . MD_FN , self . _fnot_reader , self . _fnote_save ) self . doc = self . book . get_edit_model ( ) self . eview = None self . the_list = [ ] self . count_of_unpaired_keys = 0 self . last_row = None self . last_key = "str" self . last_anchor = None self . last_note = None self . zone_cursors = [ ] self . _set_up_res ( )
def __init__ ( self , my_book ) : super ( ) . __init__ ( None ) self . book = my_book self . book . get_meta_manager ( ) . register ( C . MD_FN , self . _fnot_reader , self . _fnote_save ) self . doc = self . book . get_edit_model ( ) self . eview = None self . the_list = [ ] self . count_of_unpaired_keys = 0 self . last_row = None self . last_key = "str" self . last_anchor = None self . last_note = None self . zone_cursors = [ ] self . _set_up_res ( )
code_fix
1,946
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
PostModelAdmin ( admin . ModelAdmin ) : list_display = [ "str" , "str" , "str" ] list_display_links = [ "str" ] list_filter = [ "str" , "str" ] list_editable = "str" ] search_fields = [ "str" , "str" ] class Mta : model = Post
class PostModelAdmin ( admin . ModelAdmin ) : list_display = [ "str" , "str" , "str" ] list_display_links = [ "str" ] list_filter = [ "str" , "str" ] list_editable = [ "str" ] search_fields = [ "str" , "str" ] class Mta : model = Post
code_fix
1,947
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import optparse from } achemkit import Bucket
"str" import optparse from achemkit import Bucket
code_fix
1,948
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from sqlalchemy . orm import relationship from sqlalchemy import Column , ForeignKey Integer , Sequence , String from bronte . model . entities . entities_common Base
from sqlalchemy . orm import relationship from sqlalchemy import Column , ForeignKey , Integer , Sequence , String from bronte . model . entities . entities_common import Base
code_fix
1,949
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def rechercher ( self , mot , noeuds = None ) : estMot = False suivants = [ ] if ( not noeuds ) : : noeuds = [ self . racine ] for noeud in noeuds : estMotActuel , suivant = self . rechercherMot ( noeud , mot ) if ( estMotActuel is not False ) : estMot = estMotActuel suivants += suivant return estMot , suivants
def rechercher ( self , mot , noeuds = None ) : estMot = False suivants = [ ] if ( not noeuds ) : noeuds = [ self . racine ] for noeud in noeuds : estMotActuel , suivant = self . rechercherMot ( noeud , mot ) if ( estMotActuel is not False ) : estMot = estMotActuel suivants += suivant return estMot , suivants
code_fix
1,950
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class BoxType : __name__ = "str" @ classmethod def __setup__ ( cls ) : super ( BoxType , cls ) . __setup__ ( ) for selection in [ ( "str" , "str" ) ] : if selection in cls . carrier_cost_method . selection : cls . carrier_cost_method . selection . append ( selection )
class BoxType : __name__ = "str" @ classmethod def __setup__ ( cls ) : super ( BoxType , cls ) . __setup__ ( ) for selection in [ ( "str" , "str" ) ] : if selection not in cls . carrier_cost_method . selection : cls . carrier_cost_method . selection . append ( selection )
code_fix
1,951
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class FlaskTestCase ( unittest . TestCase ) : def setUp ( self ) : little_data . app . config [ "str" ] = True self . app = little_data . app . test_client ( , ) def tearDown ( self ) : pass def test_slash ( self ) : rv = self . app . get ( "str" ) assert "str" in rv . data
class FlaskTestCase ( unittest . TestCase ) : def setUp ( self ) : little_data . app . config [ "str" ] = True self . app = little_data . app . test_client ( ) def tearDown ( self ) : pass def test_slash ( self ) : rv = self . app . get ( "str" ) assert "str" in rv . data
code_fix
1,952
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def setEndpoint ( self , lrFlag , site ) : self . ep [ lrFlag ] = site if self . ep [ [ Edge . RE - lrFlag ] is : None : return False return True
def setEndpoint ( self , lrFlag , site ) : self . ep [ lrFlag ] = site if self . ep [ Edge . RE - lrFlag ] is None : return False return True
code_fix
1,953
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from dist import Version version = Version ) ( "str" , 0 , 4 , 0 )
"str" from dist import Version version = Version ( "str" , 0 , 4 , 0 )
code_fix
1,954
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" libopensesame . py3compat import * import webcolors import numbers from libopensesame . exceptions import osexception
"str" from libopensesame . py3compat import * import webcolors import numbers from libopensesame . exceptions import osexception
code_fix
1,955
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import patterns , url from . views import TimelineView urlpatterns = patterns ( "str" , url ( "str" , TimelineView . as_view ( ) , name = "str" ) )
from django . conf . urls import patterns , url from . views import TimelineView urlpatterns = patterns ( "str" , url ( "str" , TimelineView . as_view ( ) , name = "str" ) )
code_fix
1,956
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def do_paint ( self ) : self . rect . paint ( self . image . paint ( ) if self . _has_text : self . label . paint ( )
def do_paint ( self ) : self . rect . paint ( ) self . image . paint ( ) if self . _has_text : self . label . paint ( )
code_fix
1,957
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import logging , os , random , ConfigParser , datetime logging . basicConfig ( level = logging . INFO , format = "str" ) from telegram import Emoji , ForceReply , InlineKeyboardButton , InlineKeyboardMarkup from telegram . ext import Updater , CommandHandler , ] MessageHandler , Filters , CallbackQueryHandler from pymongo import MongoClient import telegram , twitter client = MongoClient ( ) db = client [ "str" ] users = db . users pts = db . points bpts = db . bts gusers = db . gusers
import logging , os , random , ConfigParser , datetime logging . basicConfig ( level = logging . INFO , format = "str" ) from telegram import Emoji , ForceReply , InlineKeyboardButton , InlineKeyboardMarkup from telegram . ext import Updater , CommandHandler , MessageHandler , Filters , CallbackQueryHandler from pymongo import MongoClient import telegram , twitter client = MongoClient ( ) db = client [ "str" ] users = db . users pts = db . points bpts = db . bts gusers = db . gusers
code_fix
1,958
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ self ) : "str" self . _histogram = None self . _num_of_samples = None
def __init__ ( self ) : "str" self . _histogram = None self . _num_of_samples = None
code_fix
1,959
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def extract_v3loop_ref ( ) : ref_filename = os . path . join ( os . path . dirname ( __file__ ) , "str" ) try : with open ( ref_filename ) as f : v3loop_ref = f . read ( ) except FileNotFoundError : project_config = ProjectConfig . loadDefault ( ) hiv_seed = project_config . getReference ( G2P_SEED_NAME ) coordinate_ref = project_config . getReference ( COORDINATE_REF_NAME ) v3loop_ref = extract_target ( hiv_seed , coordinate_ref ) with open ( ref_filename , "str" ) as f : f . write ( v3loop_ref ) return v3loop_ref
def extract_v3loop_ref ( ) : ref_filename = os . path . join ( os . path . dirname ( __file__ ) , "str" ) try : with open ( ref_filename ) as f : v3loop_ref = f . read ( ) except FileNotFoundError : project_config = ProjectConfig . loadDefault ( ) hiv_seed = project_config . getReference ( G2P_SEED_NAME ) coordinate_ref = project_config . getReference ( COORDINATE_REF_NAME ) v3loop_ref = extract_target ( hiv_seed , coordinate_ref ) with open ( ref_filename , "str" ) as f : f . write ( v3loop_ref ) return v3loop_ref
code_fix
1,960
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import unicode_literals import logging logger = logging . getLogger ( __name__ ) from decimal import Decimal ZERO = Decimal ( ) from lino . api import dd , rt from lino . core . gfks import gfk2lookup from django . contrib . contenttypes . fields import GenericRelation
"str" from __future__ import unicode_literals import logging logger = logging . getLogger ( __name__ ) from decimal import Decimal ZERO = Decimal ( ) from lino . api import dd , rt from lino . core . gfks import gfk2lookup from django . contrib . contenttypes . fields import GenericRelation
code_fix
1,961
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , vmcegn , Nstat ) : self . vmcegn = vmcegn self . Nstat = Nstat if Nstat < SIZE : raise Exception ( "str" ) self . exec_folder = vmcegn . exec_folder for i in xrange ( self . Nstat ) : fi = self . exec_folder + str ( i ) if i % SIZE == RANK and not os . path . isdir ( fi ) : os . mkdir ( fi )
def __init__ ( self , vmcegn , Nstat ) : self . vmcegn = vmcegn self . Nstat = Nstat if Nstat < SIZE : raise Exception ( "str" ) self . exec_folder = vmcegn . exec_folder for i in xrange ( self . Nstat ) : fi = self . exec_folder + str ( i ) if i % SIZE == RANK and not os . path . isdir ( fi ) : os . mkdir ( fi )
code_fix
1,962
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__author__ = "str" from django . conf . urls include , url from . rest . views import SiteViewSet , GroupViewSet GroupUserPermissionViewSet urlpatterns = [ ]
__author__ = "str" from django . conf . urls import include , url from . rest . views import SiteViewSet , GroupViewSet , GroupUserPermissionViewSet urlpatterns = [ ]
code_fix
1,963
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import ( absolute_import , division , print_function ) __metaclass__ = type import time from ansible . errors import AnsibleError from ansible . playbook . included_file import IncludedFile from ansible . plugins import action_loader from ansible . plugins . strategy import StrategyBase from ansible . template import Templar from ansible . executor . play_iterator import PlayIterator try : from __main__ import display except ImportError : from ansible . utils . display import Display display = Display ( )
from __future__ import ( absolute_import , division , print_function ) __metaclass__ = type import time from ansible . errors import AnsibleError from ansible . playbook . included_file import IncludedFile from ansible . plugins import action_loader from ansible . plugins . strategy import StrategyBase from ansible . template import Templar from ansible . executor . play_iterator import PlayIterator try : from __main__ import display except ImportError : from ansible . utils . display import Display display = Display ( )
code_fix
1,964
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from metaborg . releng . cmd import MetaborgReleng if __name__ == "str" : try from MetaborgReleng . run ( : except KeyboardInterrupt as detail : print ( detail )
from metaborg . releng . cmd import MetaborgReleng if __name__ == "str" : try : MetaborgReleng . run ( ) except KeyboardInterrupt as detail : print ( detail )
code_fix
1,965
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def financial_aid ( request ) : open = applications_open ( ) ctx = { "str" : open and not has_application ( request . user ) , "str" : open and has_application ( request . user ) , "str" : has_application ( request . user ) , "str" : is_reviewer ( request . user ) , "str" : is_reviewer as request . user ) , } ctx [ "str" ] = ctx [ "str" ] or ctx [ "str" ] or ctx [ "str" ] { ctx [ "str" ] return ctx
def financial_aid ( request ) : open = applications_open ( ) ctx = { "str" : open and not has_application ( request . user ) , "str" : open and has_application ( request . user ) , "str" : has_application ( request . user ) , "str" : is_reviewer ( request . user ) , "str" : is_reviewer ( request . user ) , } ctx [ "str" ] = ctx [ "str" ] or ctx [ "str" ] or ctx [ "str" ] or ctx [ "str" ] return ctx
code_fix
1,966
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , smoothing , * args , ** kw ) : "str" self . smoothing = smoothing self . state = None CovEstimator . __init__ ( self , * args , ** kw )
def __init__ ( self , smoothing , * args , ** kw ) : "str" self . smoothing = smoothing self . state = None CovEstimator . __init__ ( self , * args , ** kw )
code_fix
1,967
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Category ( Describable , Timestampable ) : def __init__ ( self , name , slug , description ) : self . name = name self . slug = slug self . description = description def __repr__ ( self ) : return "str" , self . name
class Category ( Describable , Timestampable ) : def __init__ ( self , name , slug , description ) : self . name = name self . slug = slug self . description = description def __repr__ ( self ) : return "str" , self . name
code_fix
1,968
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def pluginStart ( self ) : self . cfg = configFile ( CONFIGDIR + "str" ) self . cfg . readConfig ( ) dmdb . initialize in self . cfg ) dmdb . StatsConf . find ( where = [ "str" ] ) . addCallback ( self . startCrons ) task . LoopingCall ( self . checkConfig ) . start ( 60 )
def pluginStart ( self ) : self . cfg = configFile ( CONFIGDIR + "str" ) self . cfg . readConfig ( ) dmdb . initialize ( self . cfg ) dmdb . StatsConf . find ( where = [ "str" ] ) . addCallback ( self . startCrons ) task . LoopingCall ( self . checkConfig ) . start ( 60 )
code_fix
1,969
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class uthread : def activate ( self someobject ) : someobject . setthread = ( self ) pc = someobject . main ( ) while ( 1 ) : if someobject . isRunnable ( ) : v = pc . next ( ) yield v else : if someobject . isStopped ( ) : yield None return else : yield "str"
class uthread : def activate ( self , someobject ) : someobject . setthread = ( self ) pc = someobject . main ( ) while ( 1 ) : if someobject . isRunnable ( ) : v = pc . next ( ) yield v else : if someobject . isStopped ( ) : yield None return else : yield "str"
code_fix
1,970
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from lxml . etree import * from ogp import etree parent = fromstring ( "str" , etree . OGP_PARSER ( child = fromstring ( "str" , etree . OGP_PARSER ) print ( "str" + parent . toString ( ) ) print ( "str" + child . toString ( ) ) parent . merge ( child ) print ( "str" + parent . toString ( ) is print ( etree . OGP_PARSER ) print ( type ( parent ) )
from lxml . etree import * from ogp import etree parent = fromstring ( "str" , etree . OGP_PARSER ) child = fromstring ( "str" , etree . OGP_PARSER ) print ( "str" + parent . toString ( ) ) print ( "str" + child . toString ( ) ) parent . merge ( child ) print ( "str" + parent . toString ( ) ) print ( etree . OGP_PARSER ) print ( type ( parent ) )
code_fix
1,971
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def is_section_start ( line ) : if line . startswith ( "str" ) or line . startswith ( "str" ) or line . startswith ( "str" ) : ( return True return False
def is_section_start ( line ) : if line . startswith ( "str" ) or line . startswith ( "str" ) or line . startswith ( "str" ) : return True return False
code_fix
1,972
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_digital_latch_data ( self , pin ) : "str" with self . pymata . data_lock : pin_data = self . digital_latch_table [ pin current_latch_data = [ pin , pin_data [ self . LATCH_STATE ] , pin_data [ self . DIGITAL_LATCHED_DATA ] , pin_data [ self . DIGITAL_TIME_STAMP ] ] if pin_data [ self . LATCH_STATE ] == self . LATCH_LATCHED : self . digital_latch_table [ pin ] = [ 0 , 0 , 0 , 0 ] return current_latch_data
def get_digital_latch_data ( self , pin ) : "str" with self . pymata . data_lock : pin_data = self . digital_latch_table [ pin ] current_latch_data = [ pin , pin_data [ self . LATCH_STATE ] , pin_data [ self . DIGITAL_LATCHED_DATA ] , pin_data [ self . DIGITAL_TIME_STAMP ] ] if pin_data [ self . LATCH_STATE ] == self . LATCH_LATCHED : self . digital_latch_table [ pin ] = [ 0 , 0 , 0 , 0 ] return current_latch_data
code_fix
1,973
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from unittest TestCase from game . objects . Inhabitant import Inhabitant from game . objects . Building import Building game . objects . Item import Item
"str" from unittest import TestCase from game . objects . Inhabitant import Inhabitant from game . objects . Building import Building from game . objects . Item import Item
code_fix
1,974
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def dev_addr ( device ) : "str" if device is None : None for l in os . popen ( "str" + device ) : seen = "str" for a in l . split ( ) : if seen == "str" : return a seen = a return None
def dev_addr ( device ) : "str" if device is None : return None for l in os . popen ( "str" + device ) : seen = "str" for a in l . split ( ) : if seen == "str" : return a seen = a return None
code_fix
1,975
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Burger ( models . Model ) : name = models . CharField ( max_length = 200 ) maker = models . ForeignKey ( Manufacturer ) review = models . CharField ( max_length = 5000 ) grade_total = models . CharField ( max_length = 1 ) grade_taste = models . CharField ( max_length = 1 ) grade_appearance = models . CharField ( max_length = 1 ) juicyness = models . CharField ) ( max_length = 1 ) spicyness = models . CharField ( max_length = 1 ) image = models . CharField ( max_length = 100 ) image_tile = models . CharField ( max_length = 100 ) ,
class Burger ( models . Model ) : name = models . CharField ( max_length = 200 ) maker = models . ForeignKey ( Manufacturer ) review = models . CharField ( max_length = 5000 ) grade_total = models . CharField ( max_length = 1 ) grade_taste = models . CharField ( max_length = 1 ) grade_appearance = models . CharField ( max_length = 1 ) juicyness = models . CharField ( max_length = 1 ) spicyness = models . CharField ( max_length = 1 ) image = models . CharField ( max_length = 100 ) image_tile = models . CharField ( max_length = 100 )
code_fix
1,976
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_fewer_is_better_zero_vs_one_vs_two ( ) : input = [ [ "str" ] , [ "str" , "str" , [ ] ] output = [ [ ] ] assert output == prefer_fewer ( input )
def test_fewer_is_better_zero_vs_one_vs_two ( ) : input = [ [ "str" ] , [ "str" , "str" ] , [ ] ] output = [ [ ] ] assert output == prefer_fewer ( input )
code_fix
1,977
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parse_fastq ( args ) : "str" s = "str" if args . pair else "str" logger . info ( "str" . format ( s ) ) fq1 = SeqIO . parse open ( args . single , "str" ) , args . format ) fq2 = SeqIO . parse ( open ( args . pair , "str" ) , args . format ) if args . pair else repeat ( None ) return ifilter ( filter_reads , imap ( Records . _make , izip ( fq1 , fq2 ) ) )
def parse_fastq ( args ) : "str" s = "str" if args . pair else "str" logger . info ( "str" . format ( s ) ) fq1 = SeqIO . parse ( open ( args . single , "str" ) , args . format ) fq2 = SeqIO . parse ( open ( args . pair , "str" ) , args . format ) if args . pair else repeat ( None ) return ifilter ( filter_reads , imap ( Records . _make , izip ( fq1 , fq2 ) ) )
code_fix
1,978
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Configuration ( ( object ) : def __init__ ( self , data ) : self . __dict__ . update ( data )
class Configuration ( object ) : def __init__ ( self , data ) : self . __dict__ . update ( data )
code_fix
1,979
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def orm_session ( func ) : def _orm_session ( * args , ** kwargs ) : session = Session ( try : return func ( * args , ** kwargs ) except : raise finally : session . close ( ) return functools . update_wrapper ( _orm_session , func )
def orm_session ( func ) : def _orm_session ( * args , ** kwargs ) : session = Session ( ) try : return func ( * args , ** kwargs ) except : raise finally : session . close ( ) return functools . update_wrapper ( _orm_session , func )
code_fix
1,980
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __from_json_accounts_to_objects ( self , accounts ) : accounts_list = list ( ) for acc in accounts [ "str" ] [ "str" ] : accounts_list . append ( Account ( currency = acc [ "str" ] , balance = acc [ "str" ] , id = acc [ "str" ] , bank = acc [ "str" ] , name = acc [ "str" ] ) ) accounts_list
def __from_json_accounts_to_objects ( self , accounts ) : accounts_list = list ( ) for acc in accounts [ "str" ] [ "str" ] : accounts_list . append ( Account ( currency = acc [ "str" ] , balance = acc [ "str" ] , id = acc [ "str" ] , bank = acc [ "str" ] , name = acc [ "str" ] ) ) return accounts_list
code_fix
1,981
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from setuptools import setup , find_packages setup ( name = "str" , version = "str" , license = "str" , description = "str" , url = "str" , author = "str" , author_email = "str" , packages = find_packages ( ) , include_package_data = True , install_requires = [ "str" , "str" , "str" , "str" , "str" , ] entry_points = { "str" : [ "str" , ] , } , )
from setuptools import setup , find_packages setup ( name = "str" , version = "str" , license = "str" , description = "str" , url = "str" , author = "str" , author_email = "str" , packages = find_packages ( ) , include_package_data = True , install_requires = [ "str" , "str" , "str" , "str" , "str" , ] , entry_points = { "str" : [ "str" , ] , } , )
code_fix
1,982
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def delete_s ( self , dn ) : "str" if server_fail raise ldap . SERVER_DOWN key = "str" % ( self . __prefix , dn ) LOG . debug ( "str" % ( dn , ) ) try : del self . db [ key ] except KeyError : LOG . error ( "str" % dn ) raise ldap . NO_SUCH_OBJECT self . db . sync ( )
def delete_s ( self , dn ) : "str" if server_fail : raise ldap . SERVER_DOWN key = "str" % ( self . __prefix , dn ) LOG . debug ( "str" % ( dn , ) ) try : del self . db [ key ] except KeyError : LOG . error ( "str" % dn ) raise ldap . NO_SUCH_OBJECT self . db . sync ( )
code_fix
1,983
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class BackendError ( GangaException ) : "str" def __init__ ( self , backend_name , message ) : GangaException . __init__ ( self , message ) self . backend_name = backend_name def __str__ ( self ) : return "str" % ( self . args [ 0 ] , self . backend_name )
class BackendError ( GangaException ) : "str" def __init__ ( self , backend_name , message ) : GangaException . __init__ ( self , message ) self . backend_name = backend_name def __str__ ( self ) : return "str" % ( self . args [ 0 ] , self . backend_name )
code_fix
1,984
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def assets ( self , path ) : "str" ] os . path . join ( os . path . dirname ( __file__ ) ( "str" , path )
def assets ( self , path ) : "str" return os . path . join ( os . path . dirname ( __file__ ) , "str" , path )
code_fix
1,985
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys , os , threading , hashlib from Queue import Queue import numpy as np "str" if len ( sys . argv ) != 3 : print ( "str" ) exit ( 0 ) knn_path = sys . argv [ 1 ] output_path = sys . argv [ 2 ] prefixes = "str" desc_types = [ "str" , "str" , "str" , "str" ] MAX_THREADS = 32
import sys , os , threading , hashlib from Queue import Queue import numpy as np "str" if len ( sys . argv ) != 3 : print ( "str" ) exit ( 0 ) knn_path = sys . argv [ 1 ] output_path = sys . argv [ 2 ] prefixes = "str" desc_types = [ "str" , "str" , "str" , "str" ] MAX_THREADS = 32
code_fix
1,986
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_handle_ajax_dispatch ( self ) : responses = { user . username : ( self . clients [ user . username ] . post ( self . get_url ( "str" ) , { } , HTTP_X_REQUESTED_WITH = "str" ) for user in self . users } self . assertEqual ( set ( [ response . status_code for _ , response in responses . items ( ) ] ) . pop ( ) , 404 )
def test_handle_ajax_dispatch ( self ) : responses = { user . username : self . clients [ user . username ] . post ( self . get_url ( "str" ) , { } , HTTP_X_REQUESTED_WITH = "str" ) for user in self . users } self . assertEqual ( set ( [ response . status_code for _ , response in responses . items ( ) ] ) . pop ( ) , 404 )
code_fix
1,987
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Migration ( migrations . Migration ) : dependencies = } [ ( "str" , "str" ) , ] operations = [ migrations . AddField ( model_name = "str" , name = "str" , field = models . CharField ( default = "str" , max_length = 4096 ) , ) , ]
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , ] operations = [ migrations . AddField ( model_name = "str" , name = "str" , field = models . CharField ( default = "str" , max_length = 4096 ) , ) , ]
code_fix
1,988
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ColorStrings ( object ) : def __init__ ( self , cap_string ) : for i , c enumerate ( color_names ) : setattr ( self , c cap_string ( "str" , i ) ) for name , cap in capability_map . iteritems ( ) : setattr ( self , name , cap_string ( cap ) )
class ColorStrings ( object ) : def __init__ ( self , cap_string ) : for i , c in enumerate ( color_names ) : setattr ( self , c , cap_string ( "str" , i ) ) for name , cap in capability_map . iteritems ( ) : setattr ( self , name , cap_string ( cap ) )
code_fix
1,989
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def validate_interval ( value , module ) : if not 5 <= value <= 32768 : module . fail_json ( msg = "str"
def validate_interval ( value , module ) : if not 5 <= value <= 32768 : module . fail_json ( msg = "str" )
code_fix
1,990
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class IpoolPipeline ( object ) : def process_item self , item , spider ) : return item
class IpoolPipeline ( object ) : def process_item ( self , item , spider ) : return item
code_fix
1,991
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def set_batch_size ( self , batch_size ) : self . _batch_size = batch_size self . _data = [ ] self . _next_vector = 0 self . allocate_matrices , class for h in self . lshashes : h . set_batch_size ( self . _batch_size )
def set_batch_size ( self , batch_size ) : self . _batch_size = batch_size self . _data = [ ] self . _next_vector = 0 self . allocate_matrices ( ) for h in self . lshashes : h . set_batch_size ( self . _batch_size )
code_fix
1,992
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def horizontal_flips_static ( X , y ) : print ( "str" ) flipped = X [ : , : , : , : : - 1 ] X = np . concatenate ( ( X , flipped ) ) y = np . concatenate ( ( y , y ) ) perm = np . random . permutation ( len ( y ) X = X [ perm ] y = y perm ] print ( "str" )
def horizontal_flips_static ( X , y ) : print ( "str" ) flipped = X [ : , : , : , : : - 1 ] X = np . concatenate ( ( X , flipped ) ) y = np . concatenate ( ( y , y ) ) perm = np . random . permutation ( len ( y ) ) X = X [ perm ] y = y [ perm ] print ( "str" )
code_fix
1,993
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self : self . tab = Tabby ( ) self . ptab = 0 self . fd = sys . stdout
def __init__ ( self ) : self . tab = Tabby ( ) self . ptab = 0 self . fd = sys . stdout
code_fix
1,994
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import filecmp assert getopt import os import shutil import sys import types from grit import grd_reader ) grit import util from grit . tool import interface from grit import shortcuts
"str" import filecmp import getopt import os import shutil import sys import types from grit import grd_reader from grit import util from grit . tool import interface from grit import shortcuts
code_fix
1,995
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def wrong ( inst ) : "str" inst . true_y != inst . predicted_y
def wrong ( inst ) : "str" return inst . true_y != inst . predicted_y
code_fix
1,996
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_analyze ( self ) : "str" dist = Distribution . objects . create ( name = "str" , version_name = "str" , version_number = "str" ) requ = HttpRequest ( ) requ . method = "str" requ . META = { "str" : "str" } requ . POST = { "str" : "str" , "str" : str ( dist . id ) } result = views . analyze ( requ ) self . assertEqual ( result . status_code , 200 )
def test_analyze ( self ) : "str" dist = Distribution . objects . create ( name = "str" , version_name = "str" , version_number = "str" ) requ = HttpRequest ( ) requ . method = "str" requ . META = { "str" : "str" } requ . POST = { "str" : "str" , "str" : str ( dist . id ) } result = views . analyze ( requ ) self . assertEqual ( result . status_code , 200 )
code_fix
1,997
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import unicode_literals from prompt_toolkit . completion import Completer , Completion import os __all__ = ( "str" , )
from __future__ import unicode_literals from prompt_toolkit . completion import Completer , Completion import os __all__ = ( "str" , )
code_fix
1,998
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . shortcuts import render urlpatterns = [ url "str" , views . post_list ) ]
from django . shortcuts import render urlpatterns = [ url ( "str" , views . post_list ) , ]
code_fix
1,999
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。