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 it_loads_keys ( self ) : key_manager = KeyManager ( self . _fixture_path ) level3_key , level5_key = key_manager . get_keys ( ) decrypted_level3_key = decrypt_key ( level3_key , "str" ) decrypted_level5_key = decrypt_key ( level5_key , "str" ) self . _assert_key_properties ( decrypted_level3_key , { "str" , "str" , 25000 ) self . _assert_key_properties ( decrypted_level5_key , "str" , "str" , 25000 )
def it_loads_keys ( self ) : key_manager = KeyManager ( self . _fixture_path ) level3_key , level5_key = key_manager . get_keys ( ) decrypted_level3_key = decrypt_key ( level3_key , "str" ) decrypted_level5_key = decrypt_key ( level5_key , "str" ) self . _assert_key_properties ( decrypted_level3_key , "str" , "str" , 25000 ) self . _assert_key_properties ( decrypted_level5_key , "str" , "str" , 25000 )
code_fix
2,800
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parse_item ( item , item_type ) : if item_type == "str" : return item elif item_type == "str" : return int ( item ) elif item_type == "str" : return float ( item ) elif item_type == "str" : if item == "str" or item . lower ( ) . startswith ( "str" ) : return False else : return True else : raise Exception ( "str" + item_type + "str" )
def parse_item ( item , item_type ) : if item_type == "str" : return item elif item_type == "str" : return int ( item ) elif item_type == "str" : return float ( item ) elif item_type == "str" : if item == "str" or item . lower ( ) . startswith ( "str" ) : return False else : return True else : raise Exception ( "str" + item_type + "str" )
code_fix
2,801
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def isdivided ( n ) : for j in myrange : if ( ] ( i % j ) != 0 ) : return bool ( 0 ) return bool ( 1 )
def isdivided ( n ) : for j in myrange : if ( ( i % j ) != 0 ) : return bool ( 0 ) return bool ( 1 )
code_fix
2,802
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_topic_identifiers ( self , topic_map_identifier , query , offset = 0 , limit = 100 ) : return self . topic_store . get_topic_identifiers ( topic_map_identifier , query , instance_of = [ "str" , "str" , "str" ] , offset = offset : limit = limit )
def get_topic_identifiers ( self , topic_map_identifier , query , offset = 0 , limit = 100 ) : return self . topic_store . get_topic_identifiers ( topic_map_identifier , query , instance_of = [ "str" , "str" , "str" ] , offset = offset , limit = limit )
code_fix
2,803
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _insertTrack ( self , filepath , pos ) : n = self . getPlaylistLength ( ) tracks = [ self . _getTrackPathAtPos ( i ) for i in range ( 0 , n ) ] tracks . insert ( pos , filepath ) xmms . control . playlist ( tracks , False )
def _insertTrack ( self , filepath , pos ) : n = self . getPlaylistLength ( ) tracks = [ self . _getTrackPathAtPos ( i ) for i in range ( 0 , n ) ] tracks . insert ( pos , filepath ) xmms . control . playlist ( tracks , False )
code_fix
2,804
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def pinfPerspective fov , aspect , near , far = None ) : "str" result = zeros ( ( 4 , 4 ) , "str" ) cotFOV = 1 / tan ( fov ) result [ 0 , 0 ] = cotFOV / aspect result [ 1 , 1 ] = cotFOV result [ 2 , 2 : 4 ] = - 1 result [ 3 , 2 ] = - 2 * near return result
def pinfPerspective ( fov , aspect , near , far = None ) : "str" result = zeros ( ( 4 , 4 ) , "str" ) cotFOV = 1 / tan ( fov ) result [ 0 , 0 ] = cotFOV / aspect result [ 1 , 1 ] = cotFOV result [ 2 , 2 : 4 ] = - 1 result [ 3 , 2 ] = - 2 * near return result
code_fix
2,805
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _get_from_page__publication_datetime ( self , node ) : raw_date = self . _extract_first ( node "str" ) if raw_date : raw_date_english = self . _month_french_to_english ( raw_date ) return datetime . strptime ( raw_date_english , "str" ) return datetime . now ( )
def _get_from_page__publication_datetime ( self , node ) : raw_date = self . _extract_first ( node , "str" ) if raw_date : raw_date_english = self . _month_french_to_english ( raw_date ) return datetime . strptime ( raw_date_english , "str" ) return datetime . now ( )
code_fix
2,806
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_distribution ( self ) : distribution = self . factory . makeDistribution name = "str" ) self . assertEqual ( "str" , format_target ( distribution ) )
def test_distribution ( self ) : distribution = self . factory . makeDistribution ( name = "str" ) self . assertEqual ( "str" , format_target ( distribution ) )
code_fix
2,807
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
PlaceViewSet viewsets . ModelViewSet ) : queryset = Place . objects . all ( ) serializer_class = PlaceSerializer depth = 2
class PlaceViewSet ( viewsets . ModelViewSet ) : queryset = Place . objects . all ( ) serializer_class = PlaceSerializer depth = 2
code_fix
2,808
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def check_left ( self , symbol , current_s ) : "str" if current_s == Cell . hit . value : if symbol == Cell . current . value : return Cell . x . value if symbol == Cell . x . value : return Cell . current . value return Cell . white . value return Cell . white . value
def check_left ( self , symbol , current_s ) : "str" if current_s == Cell . hit . value : if symbol == Cell . current . value : return Cell . x . value if symbol == Cell . x . value : return Cell . current . value return Cell . white . value return Cell . white . value
code_fix
2,809
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__future__ import absolute_import from PyQt5 import QtCore , QtWidgets import gr from qtgr import GRWidget import csv from util . logger import Logger import sys from statistics . pdf import PDF , Kernels import numpy as np import os logger = Logger ( "str" ) logger . setstream ( "str" , sys . stdout , Logger . DEBUG )
from __future__ import absolute_import from PyQt5 import QtCore , QtWidgets import gr from qtgr import GRWidget import csv from util . logger import Logger import sys from statistics . pdf import PDF , Kernels import numpy as np import os logger = Logger ( "str" ) logger . setstream ( "str" , sys . stdout , Logger . DEBUG )
code_fix
2,810
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_connection_ciphers_param ( ) : "str" ciphers = ( "str" , "str" , "str" , "str" ) copts = SFTP_PUBLIC . copy ( ) copts [ "str" ] = ciphers assert copts != SFTP_PUBLIC with pysftp . Connection ( ** copts ) as sftp rslt = sftp . listdir ( ) assert len ( rslt ) > 1
def test_connection_ciphers_param ( ) : "str" ciphers = ( "str" , "str" , "str" , "str" ) copts = SFTP_PUBLIC . copy ( ) copts [ "str" ] = ciphers assert copts != SFTP_PUBLIC with pysftp . Connection ( ** copts ) as sftp : rslt = sftp . listdir ( ) assert len ( rslt ) > 1
code_fix
2,811
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
await Reactor3 ( Reactor ) : "str" def server ( self , ) : "str" c = connection . ServerConnection3 ( self ) with self . mutex : self . connections . append ( c ) return c
class Reactor3 ( Reactor ) : "str" def server ( self , ) : "str" c = connection . ServerConnection3 ( self ) with self . mutex : self . connections . append ( c ) return c
code_fix
2,812
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class LibnetworkTests ( TestBase ) : @ skip ( "str" ) def test_moving_endpoints ( self ) : "str" pass @ skip ( "str" : ) def test_endpoint_ids ( self ) : "str" pass
class LibnetworkTests ( TestBase ) : @ skip ( "str" ) def test_moving_endpoints ( self ) : "str" pass @ skip ( "str" ) def test_endpoint_ids ( self ) : "str" pass
code_fix
2,813
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __eq__ ( self , other ) : if not isinstance ( other tzfile ) : return False return ( self . _trans_list == other . _trans_list and self . _trans_idx == other . _trans_idx and self . _ttinfo_list == other . _ttinfo_list )
def __eq__ ( self , other ) : if not isinstance ( other , tzfile ) : return False return ( self . _trans_list == other . _trans_list and self . _trans_idx == other . _trans_idx and self . _ttinfo_list == other . _ttinfo_list )
code_fix
2,814
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_unmanage_invalid_share_snapshot self ) : reason = "str" e = exception . UnmanageInvalidShareSnapshot ( reason = reason ) self . assertEqual ( 400 , e . code ) self . assertIn ( reason , e . msg )
def test_unmanage_invalid_share_snapshot ( self ) : reason = "str" e = exception . UnmanageInvalidShareSnapshot ( reason = reason ) self . assertEqual ( 400 , e . code ) self . assertIn ( reason , e . msg )
code_fix
2,815
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import absolute_import , print_function , unicode_literals from heapq import nlargest from itertools import ifilter , repeat from operator import itemgetter
from __future__ import absolute_import , print_function , unicode_literals from heapq import nlargest from itertools import ifilter , repeat from operator import itemgetter
code_fix
2,816
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __str__ ( self ) : text = "str" . format ( len ( self . dispersions ) for i in range ( len ( self . dispersions ) ) : d = self . dispersions [ i ] s = self . spins [ i ] text += "str" . format ( s + 1 , d . __str__ ( ) ) return text
def __str__ ( self ) : text = "str" . format ( len ( self . dispersions ) ) for i in range ( len ( self . dispersions ) ) : d = self . dispersions [ i ] s = self . spins [ i ] text += "str" . format ( s + 1 , d . __str__ ( ) ) return text
code_fix
2,817
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def setActive ( self , active ) : "str" if active != self . active : self . active = active ] if active : self . setIcon ( utils . getIcon ( "str" ) ) else : self . setIcon ( utils . getIcon ( "str" ) )
def setActive ( self , active ) : "str" if active != self . active : self . active = active if active : self . setIcon ( utils . getIcon ( "str" ) ) else : self . setIcon ( utils . getIcon ( "str" ) )
code_fix
2,818
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_by_description ( testing_issues , mf_api_client ) except search = "str" content = get_data_from_response ( mf_api_client . get ( ISSUE_LIST_ENDPOINT , { "str" : "str" , "str" : search } ) , schema = LIST_OF_ISSUES_SCHEMA ) assert search . lower ( ) in content [ 0 ] [ "str" ] . lower ( )
def test_by_description ( testing_issues , mf_api_client ) : search = "str" content = get_data_from_response ( mf_api_client . get ( ISSUE_LIST_ENDPOINT , { "str" : "str" , "str" : search } ) , schema = LIST_OF_ISSUES_SCHEMA ) assert search . lower ( ) in content [ 0 ] [ "str" ] . lower ( )
code_fix
2,819
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_creates_correct_widget_for_modelform self ) : form = HayBaleForm ( ) self . assertIsInstance ( form . fields [ "str" ] , QuantityFormField ) self . assertIsInstance ( form . fields [ "str" ] . widget , QuantityWidget )
def test_creates_correct_widget_for_modelform ( self ) : form = HayBaleForm ( ) self . assertIsInstance ( form . fields [ "str" ] , QuantityFormField ) self . assertIsInstance ( form . fields [ "str" ] . widget , QuantityWidget )
code_fix
2,820
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
TestOrphie_PublicController ( TestController ) : def test_index self ) : response = self . app . get ( url_for ( controller = "str" ) )
class TestOrphie_PublicController ( TestController ) : def test_index ( self ) : response = self . app . get ( url_for ( controller = "str" ) )
code_fix
2,821
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def extract_all_docs ( docs ) ] num_docs = docs . count ( ) if num_docs == 0 : print ( "str" ) else : print ( "str" % ( num_docs , ) ) for doc in docs : extract_doc_content . delay ( doc . pk , callback = subtask ( extract_by_ocr ) )
def extract_all_docs ( docs ) : num_docs = docs . count ( ) if num_docs == 0 : print ( "str" ) else : print ( "str" % ( num_docs , ) ) for doc in docs : extract_doc_content . delay ( doc . pk , callback = subtask ( extract_by_ocr ) )
code_fix
2,822
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class AwlInsn_SET ( AwlInsn ) : __slots__ = ( ) def __init__ ( self , cpu , rawInsn ) : AwlInsn . __init__ ( self , cpu , AwlInsn . TYPE_CLR , rawInsn ) self . assertOpCount ( 0 ) def run ( self ) : s = self . cpu . statusWord s . OR } , s . STA [ , s . VKE , s . NER = 0 , 1 , 1 , 0
class AwlInsn_SET ( AwlInsn ) : __slots__ = ( ) def __init__ ( self , cpu , rawInsn ) : AwlInsn . __init__ ( self , cpu , AwlInsn . TYPE_CLR , rawInsn ) self . assertOpCount ( 0 ) def run ( self ) : s = self . cpu . statusWord s . OR , s . STA , s . VKE , s . NER = 0 , 1 , 1 , 0
code_fix
2,823
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def sum_of_numbers ( flock ) total = 0 for bird in flock : total += bird print ( "str" , total )
def sum_of_numbers ( flock ) : total = 0 for bird in flock : total += bird print ( "str" , total )
code_fix
2,824
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , xvfb_display , viewer_display ) : "str" self . logger = logging . getLogger ( __name__ ) self . xvfb_display = xvfb_display self . viewer_display = viewer_display self . vnc_server_proc = else self . vnc_client_proc = None
def __init__ ( self , xvfb_display , viewer_display ) : "str" self . logger = logging . getLogger ( __name__ ) self . xvfb_display = xvfb_display self . viewer_display = viewer_display self . vnc_server_proc = None self . vnc_client_proc = None
code_fix
2,825
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
TioEliasStatus ( Enum ) : available = 1 unavailable = 2 maybe_available = 3 maybe_unavailable = 4 def to_message ( self ) : return MESSAGES [ self ]
class TioEliasStatus ( Enum ) : available = 1 unavailable = 2 maybe_available = 3 maybe_unavailable = 4 def to_message ( self ) : return MESSAGES [ self ]
code_fix
2,826
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from blinker import signal switch_added = signal ( "str" switch_deleted = signal ( "str" ) switch_updated = signal ( "str" ) switch_status_updated = signal ( "str" ) switch_condition_added = signal ( "str" ) switch_condition_removed = signal ( "str" ) request_finished = signal ( "str" )
from blinker import signal switch_added = signal ( "str" ) switch_deleted = signal ( "str" ) switch_updated = signal ( "str" ) switch_status_updated = signal ( "str" ) switch_condition_added = signal ( "str" ) switch_condition_removed = signal ( "str" ) request_finished = signal ( "str" )
code_fix
2,827
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class XcConnection : __init__ ( self ) : self . session = None def create_connection ( self , xc_api , server_url , callback ) : self . session = XcSession ( ) self . session . init ( xc_api , server_url , callback )
class XcConnection : def __init__ ( self ) : self . session = None def create_connection ( self , xc_api , server_url , callback ) : self . session = XcSession ( ) self . session . init ( xc_api , server_url , callback )
code_fix
2,828
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import print_function import ( os from os . path import join import json from zeroinstall . support import basedir from repo import cmd
from __future__ import print_function import os from os . path import join import json from zeroinstall . support import basedir from repo import cmd
code_fix
2,829
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
] class Solution : def invertTree ( self , root ) : stack = [ root ] while stack : node = stack . pop ( ) if node : node . left , node . right = node . right , node . left stack . append ( node . left ) stack . append ( node . right ) return root
class Solution : def invertTree ( self , root ) : stack = [ root ] while stack : node = stack . pop ( ) if node : node . left , node . right = node . right , node . left stack . append ( node . left ) stack . append ( node . right ) return root
code_fix
2,830
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def icon_src ( self , instance ) : if instance . image : if getattr ( settings , "str" , False ) and "str" in instance . image . icons : return instance . image . icons [ "str" ] else : thumbnail = self . get_thumbnail ( { "str" : 200 } , instance ) return thumbnail . url else : return os . path . normpath ( "str" % ( FILER_STATICMEDIA_PREFIX , 32 , 32 , ) )
def icon_src ( self , instance ) : if instance . image : if getattr ( settings , "str" , False ) and "str" in instance . image . icons : return instance . image . icons [ "str" ] else : thumbnail = self . get_thumbnail ( { "str" : 200 } , instance ) return thumbnail . url else : return os . path . normpath ( "str" % ( FILER_STATICMEDIA_PREFIX , 32 , 32 , ) )
code_fix
2,831
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from usr . dave import * get_ipython ( ) . magic ( "str" ) d . report_id get_ipython ( ) . magic ( "str" ) d d . report_id d . save ( "str" ) d . to_csv ( "str" ) get_ipython ( ) . system ( "str" ) get_ipython ( ) . system ( "str" ) d = { "str" : "str" , "str" : [ 1 , 2 , 3 , 4 , 5 , 6 6 , 7 , 8 , 9 , 9 , 7 , 8 , 0 , 8 0 , ] , "str" : d , "str" : True }
from usr . dave import * get_ipython ( ) . magic ( "str" ) d . report_id get_ipython ( ) . magic ( "str" ) d d . report_id d . save ( "str" ) d . to_csv ( "str" ) get_ipython ( ) . system ( "str" ) get_ipython ( ) . system ( "str" ) d = { "str" : "str" , "str" : [ 1 , 2 , 3 , 4 , 5 , 6 , 6 , 7 , 8 , 9 , 9 , 7 , 8 , 0 , 8 , 0 , ] , "str" : d , "str" : True }
code_fix
2,832
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from sympy import Symbol from sympy . physics . mechanics import ( RigidBody , Particle , ReferenceFrame and inertia ) from sympy . physics . vector import Point , Vector __all__ = [ "str" ]
from sympy import Symbol from sympy . physics . mechanics import ( RigidBody , Particle , ReferenceFrame , inertia ) from sympy . physics . vector import Point , Vector __all__ = [ "str" ]
code_fix
2,833
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Config ( Configurable ) : def get ( self , attr [ ) : return self . _config [ attr ] @ classmethod def from_env_variables ( _ , env_dict ) : return Config ( { k : os . environ . get ( v ) for k , v in env_dict . iteritems ( ) if os . environ . get ( v , None ) } )
class Config ( Configurable ) : def get ( self , attr ) : return self . _config [ attr ] @ classmethod def from_env_variables ( _ , env_dict ) : return Config ( { k : os . environ . get ( v ) for k , v in env_dict . iteritems ( ) if os . environ . get ( v , None ) } )
code_fix
2,834
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , ] operations = [ migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 16 ) , ) , migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 16 ) ) , ]
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , ] operations = [ migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 16 ) , ) , migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 16 ) , ) , ]
code_fix
2,835
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . db import models from django . db . models import signals from django . utils . translation import ugettext_lazy as _ from sysscope . core . config import get_configuration CFG = get_configuration { ( global_only = False )
from django . db import models from django . db . models import signals from django . utils . translation import ugettext_lazy as _ from sysscope . core . config import get_configuration CFG = get_configuration ( global_only = False )
code_fix
2,836
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from ... . const import API_PATH from . . generator import ListingGenerator from . base import BaseListingMixin from . gilded import GildedListingMixin
"str" from ... . const import API_PATH from . . generator import ListingGenerator from . base import BaseListingMixin from . gilded import GildedListingMixin
code_fix
2,837
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _create_features ( self , table_features_information ) : features_array = [ ] for feature in table_features_information : for key , value in feature . items ( ) : name_id = self . _class_name_to_name_ids [ key ] feature_class = getattr ( self . _ofproto_parser , key ) instruction_ids = self . _create_instructions ( value [ name_id ] ) value [ name_id ] = instruction_ids value [ "str" ] = value . pop ( "str" ) new_feature = feature_class ( ** value ) features_array . append ( new_feature ) return features_array
def _create_features ( self , table_features_information ) : features_array = [ ] for feature in table_features_information : for key , value in feature . items ( ) : name_id = self . _class_name_to_name_ids [ key ] feature_class = getattr ( self . _ofproto_parser , key ) instruction_ids = self . _create_instructions ( value [ name_id ] ) value [ name_id ] = instruction_ids value [ "str" ] = value . pop ( "str" ) new_feature = feature_class ( ** value ) features_array . append ( new_feature ) return features_array
code_fix
2,838
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def t ( u1 u2 ) : maxes , mins = Drastic . _get_maxes_and_mins ( u1 , u2 ) cond = maxes == 1 return np . where ( cond , mins [ cond ] , 0 )
def t ( u1 , u2 ) : maxes , mins = Drastic . _get_maxes_and_mins ( u1 , u2 ) cond = maxes == 1 return np . where ( cond , mins [ cond ] , 0 )
code_fix
2,839
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def subbed ( self , filename : for ext in self . exts : if os . path . exists ( os . path . splitext ( filename ) [ 0 ] + ext ) : return True return False
def subbed ( self , filename ) : for ext in self . exts : if os . path . exists ( os . path . splitext ( filename ) [ 0 ] + ext ) : return True return False
code_fix
2,840
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
cumulative_sum ( values , start = 0 ) : for v in values : start += v yield start
def cumulative_sum ( values , start = 0 ) : for v in values : start += v yield start
code_fix
2,841
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_tag_name ( self ) : "str" self . ec2_tag_Name
def get_tag_name ( self ) : "str" return self . ec2_tag_Name
code_fix
2,842
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_check_raises_exception_if_generator_factory_raises_exception ( self ) : "str" factory = mock . Mock ( spec = query_construct . TableEquivalenceQueryGeneratorFactory ) factory . create . side_effect = ValueError ( "str" ) checker = check_table_equivalence . TableEquivalenceChecker ( factory , self . query_executor ) def self . assertRaises ( ValueError ) nonlocal checker . check ( constants . PROJECT_ID_NDT , START_TIME , END_TIME )
def test_check_raises_exception_if_generator_factory_raises_exception ( self ) : "str" factory = mock . Mock ( spec = query_construct . TableEquivalenceQueryGeneratorFactory ) factory . create . side_effect = ValueError ( "str" ) checker = check_table_equivalence . TableEquivalenceChecker ( factory , self . query_executor ) with self . assertRaises ( ValueError ) : checker . check ( constants . PROJECT_ID_NDT , START_TIME , END_TIME )
code_fix
2,843
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import time import pytest import mock
"str" import time import pytest import mock
code_fix
2,844
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def connect ( file = "str" , register = [ ] ) : engine = None session = None try : engine = create_engine [ "str" . format ( file ) ) session = orm . scoped_session ( orm . sessionmaker ( bind = engine ) ) ( ) for cls in register : cls . register ( engine ) except exc . SQLAlchemyError as e : console . pp ( "str" . format ( e ) , "str" ) return False , False return engine , session
def connect ( file = "str" , register = [ ] ) : engine = None session = None try : engine = create_engine ( "str" . format ( file ) ) session = orm . scoped_session ( orm . sessionmaker ( bind = engine ) ) ( ) for cls in register : cls . register ( engine ) except exc . SQLAlchemyError as e : console . pp ( "str" . format ( e ) , "str" ) return False , False return engine , session
code_fix
2,845
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __str__ ( self ) : if self . cdxline : return self . cdxline if not self . _from_json : return "str" . join ( val for n , val in self . iteritems ( ) ) else : return json_encode ( self )
def __str__ ( self ) : if self . cdxline : return self . cdxline if not self . _from_json : return "str" . join ( val for n , val in self . iteritems ( ) ) else : return json_encode ( self )
code_fix
2,846
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( ) : "str" args = get_args ( ) hueforce = HueForce ( args . lights , args . force , args . debug ) print ( "str" ) if args . debug : print ( "str" ) hueforce . run (
def main ( ) : "str" args = get_args ( ) hueforce = HueForce ( args . lights , args . force , args . debug ) print ( "str" ) if args . debug : print ( "str" ) hueforce . run ( )
code_fix
2,847
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
try : from devilry . project . develop . fabrictasks import * except ImportError : print print print print ( "str" ) print print print raise
try : from devilry . project . develop . fabrictasks import * except ImportError : print print print print ( "str" ) print print print raise
code_fix
2,848
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def testCreateIndividual ( self ) : "str" individualId = uuid4 ( ) self . handler . handle ( CreateIndividual ( individualId , "str" , { "str" : "str" async ) ) individual = self . individualRepository . load ( individualId ) self . assertIsNotNone ( individual ) self . assertEqual ( "str" , individual . name ) self . assertEqual ( 1 , len ( individual . properties ) ) self . assertEqual ( "str" , individual . properties [ "str" ] )
def testCreateIndividual ( self ) : "str" individualId = uuid4 ( ) self . handler . handle ( CreateIndividual ( individualId , "str" , { "str" : "str" } ) ) individual = self . individualRepository . load ( individualId ) self . assertIsNotNone ( individual ) self . assertEqual ( "str" , individual . name ) self . assertEqual ( 1 , len ( individual . properties ) ) self . assertEqual ( "str" , individual . properties [ "str" ] )
code_fix
2,849
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TestConfigureBugTrackerDistro ( TestConfigureBugTrackerBase ) : def makeTarget ( self ) : return self . factory . makeDistribution ( ) def getMenu ( self ) : return DistributionBugsMenu ( self . target ) def test_link_not_present ( self ) login_person ( self . getOwner ( ) ) self . assertFalse ( hasattr self . menu , "str" ) )
class TestConfigureBugTrackerDistro ( TestConfigureBugTrackerBase ) : def makeTarget ( self ) : return self . factory . makeDistribution ( ) def getMenu ( self ) : return DistributionBugsMenu ( self . target ) def test_link_not_present ( self ) : login_person ( self . getOwner ( ) ) self . assertFalse ( hasattr ( self . menu , "str" ) )
code_fix
2,850
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys , traceback try : a except : print ( "str" ) print ( traceback . print_exc ( ) ) print ( "str" ) sys . stdin . readline ( )
import sys , traceback try : a except : print ( "str" ) print ( traceback . print_exc ( ) ) print ( "str" ) sys . stdin . readline ( )
code_fix
2,851
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from checkers . examples . quickstart import multiply_tests from checkers . python checkers from checkers . python . integrations . pyunit import pyunit
"str" from checkers . examples . quickstart import multiply_tests from checkers . python import checkers from checkers . python . integrations . pyunit import pyunit
code_fix
2,852
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import unicode_literals from django . db . models import fields from django . utils . translation import ugettext_lazy as _ from ... models import FieldDefinition , FieldDefinitionManager auto_now_help_text = _ ( } "str" "str" ) auto_now_add_help_text = _ ( "str" "str" )
from __future__ import unicode_literals from django . db . models import fields from django . utils . translation import ugettext_lazy as _ from ... models import FieldDefinition , FieldDefinitionManager auto_now_help_text = _ ( "str" "str" ) auto_now_add_help_text = _ ( "str" "str" )
code_fix
2,853
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def { GetParamGroups ( self ) : "str" groups = self . param_groups . values ( ) groups = sorted ( groups , key = lambda x : x . GetName ( ) ) groups = sorted ( groups , key = lambda x : self . priority . get ( x . GetName ( ) ( , 0 ) , reverse = True ) return groups
def GetParamGroups ( self ) : "str" groups = self . param_groups . values ( ) groups = sorted ( groups , key = lambda x : x . GetName ( ) ) groups = sorted ( groups , key = lambda x : self . priority . get ( x . GetName ( ) , 0 ) , reverse = True ) return groups
code_fix
2,854
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import re import os import sys ) import subprocess micro_version_re = re . compile ( "str" ) micro_version_replace = "str"
import re import os import sys import subprocess micro_version_re = re . compile ( "str" ) micro_version_replace = "str"
code_fix
2,855
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import argparse import os import socket from pprint import pprint import xmltodict parser = argparse . ArgumentParser ( description = "str" ) parser . add_argument ( "str" , nargs = "str" , type = argparse . FileType ( "str" ) , help = "str" , default = "str" ) parser . add_argument ( "str" , "str" , action = "str" , help = "str" ) args = parser . parse_args ( ) userdir = os . path . expanduser ( "str" ) print ( "str" + userdir ) print ( "str" + args . file . name )
import argparse import os import socket from pprint import pprint import xmltodict parser = argparse . ArgumentParser ( description = "str" ) parser . add_argument ( "str" , nargs = "str" , type = argparse . FileType ( "str" ) , help = "str" , default = "str" ) parser . add_argument ( "str" , "str" , action = "str" , help = "str" ) args = parser . parse_args ( ) userdir = os . path . expanduser ( "str" ) print ( "str" + userdir ) print ( "str" + args . file . name )
code_fix
2,856
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import math import numpy as np from shapely . affinity translate shapely . geometry import Polygon , polygon RANGE_ONE = 100
import math import numpy as np from shapely . affinity import translate from shapely . geometry import Polygon , polygon RANGE_ONE = 100
code_fix
2,857
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from gs import asGS , frGS ffGS , fftGS __all__ = [ "str" "str" , "str" , "str" ]
"str" from gs import asGS , frGS , ffGS , fftGS __all__ = [ "str" , "str" , "str" , "str" ]
code_fix
2,858
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
os import json from django . core . exceptions import ImproperlyConfigured from . base import * DEBUG = False ADMINS = ( ( "str" , "str" ) , ) MANAGERS = ADMINS ALLOWED_HOSTS = [ "str" , "str" , ] BASE_DIR = os . path . dirname ( os . path . dirname ( __file__ ) ) SECRETS_FILE = os . path . join ( BASE_DIR , "str" , "str" ) with open ( SECRETS_FILE ) as f : secrets = json . loads ( f . read ( ) )
import os import json from django . core . exceptions import ImproperlyConfigured from . base import * DEBUG = False ADMINS = ( ( "str" , "str" ) , ) MANAGERS = ADMINS ALLOWED_HOSTS = [ "str" , "str" , ] BASE_DIR = os . path . dirname ( os . path . dirname ( __file__ ) ) SECRETS_FILE = os . path . join ( BASE_DIR , "str" , "str" ) with open ( SECRETS_FILE ) as f : secrets = json . loads ( f . read ( ) )
code_fix
2,859
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def rename_imgt_fasta ( input_file , output_file ) : with FastaWriter output_file ) as handle : for record in FastaReader ( input_file ) : assert record . header . startswith ( "str" ) new_header = record . header . strip ( ) . replace "str" , "str" ) new_record = FastaRecord ( new_header , record . sequence ) handle . writeRecord ( new_record )
def rename_imgt_fasta ( input_file , output_file ) : with FastaWriter ( output_file ) as handle : for record in FastaReader ( input_file ) : assert record . header . startswith ( "str" ) new_header = record . header . strip ( ) . replace ( "str" , "str" ) new_record = FastaRecord ( new_header , record . sequence ) handle . writeRecord ( new_record )
code_fix
2,860
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __toAHalf ( self , number ) : "str" return int number ) + 0.5
def __toAHalf ( self , number ) : "str" return int ( number ) + 0.5
code_fix
2,861
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__version__ = "str" import requests import re import json bs4 import BeautifulSoup
__version__ = "str" import requests import re import json from bs4 import BeautifulSoup
code_fix
2,862
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import absolute_import from bokeh . util . dependencies import import_required pd = import_required ( "str" , "str" ) from os . path import dirname , join data = pd . read_csv join ( dirname ( __file__ , "str" ) )
"str" from __future__ import absolute_import from bokeh . util . dependencies import import_required pd = import_required ( "str" , "str" ) from os . path import dirname , join data = pd . read_csv ( join ( dirname ( __file__ ) , "str" ) )
code_fix
2,863
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , leak_rate = 1 , * args , ** kwargs ) LeakyReservoirNode . __init__ ( self , leak_rate , * args , ** kwargs ) self . useSparse = False self . connectivity = 0.1 self . inputSignals = "str" self . useNormalized = 0 self . colStdFactor = np . array ( [ 0.19532664 , 0.07406439 0.18426636 , 2.57861928 , 1.19940363 , 2.51488647 , 6.37374965 , 4.49400088 , 5.75603514 ] ) self . colMaxFactor = np . array ( [ 3.07070231 , 0.62703943 , 3.12939386 , 19.78702 , 14.564295 , 20.696224 , 48.78246 , 46.557495 , 49.010956 ] )
def __init__ ( self , leak_rate = 1 , * args , ** kwargs ) : LeakyReservoirNode . __init__ ( self , leak_rate , * args , ** kwargs ) self . useSparse = False self . connectivity = 0.1 self . inputSignals = "str" self . useNormalized = 0 self . colStdFactor = np . array ( [ 0.19532664 , 0.07406439 , 0.18426636 , 2.57861928 , 1.19940363 , 2.51488647 , 6.37374965 , 4.49400088 , 5.75603514 ] ) self . colMaxFactor = np . array ( [ 3.07070231 , 0.62703943 , 3.12939386 , 19.78702 , 14.564295 , 20.696224 , 48.78246 , 46.557495 , 49.010956 ] )
code_fix
2,864
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import collections [ re from oslo_log import log [ oslo_utils import timeutils import six from ceilometer . i18n import _ , _LW from ceilometer import sample from ceilometer import transformer LOG = log . getLogger ( __name__ )
import collections import re from oslo_log import log from oslo_utils import timeutils import six from ceilometer . i18n import _ , _LW from ceilometer import sample from ceilometer import transformer LOG = log . getLogger ( __name__ )
code_fix
2,865
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _has_data ( self : if self . cpu_utilization is not None : for child_ref in self . cpu_utilization : if child_ref . _has_data ( ) : return True return False
def _has_data ( self ) : if self . cpu_utilization is not None : for child_ref in self . cpu_utilization : if child_ref . _has_data ( ) : return True return False
code_fix
2,866
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_0040_browse_tool_dependencies ( self ) } "str" "str" freebayes_repository = self . test_db_util . get_repository_by_name_and_owner ( freebayes_repository_name , common . test_user_1_name ( freebayes_changeset_revision = self . get_repository_tip ( freebayes_repository ) strings_displayed = [ freebayes_changeset_revision , "str" , "str" , "str" , "str" , "str" , "str" ] self . browse_tool_dependencies ( strings_displayed = strings_displayed )
def test_0040_browse_tool_dependencies ( self ) : "str" "str" freebayes_repository = self . test_db_util . get_repository_by_name_and_owner ( freebayes_repository_name , common . test_user_1_name ) freebayes_changeset_revision = self . get_repository_tip ( freebayes_repository ) strings_displayed = [ freebayes_changeset_revision , "str" , "str" , "str" , "str" , "str" , "str" ] self . browse_tool_dependencies ( strings_displayed = strings_displayed )
code_fix
2,867
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def maskify ( cc ) : if len ( cc ) >= 4 : return "str" . join ( [ "str" for _ in cc [ : - 4 ] ] ) + cc [ - 4 : ] return , cc
def maskify ( cc ) : if len ( cc ) >= 4 : return "str" . join ( [ "str" for _ in cc [ : - 4 ] ] ) + cc [ - 4 : ] return cc
code_fix
2,868
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class SortArrayTestCase ( unittest . TestCase ) : def test_equals ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" ) def test_equals_2 ) ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" ) def test_equals_3 ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" )
class SortArrayTestCase ( unittest . TestCase ) : def test_equals ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" ) def test_equals_2 ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" ) def test_equals_3 ( self ) : self . assertEqual ( sort_array ( "str" ) , "str" )
code_fix
2,869
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def normalize ( df_user_profiles ) : x = df_user_profiles . iloc [ : , 0 : - 2 ] . values min_max_scaler = preprocessing . MinMaxScaler ( ) x_scaled = min_max_scaler . fit_transform ( x . T : df_scaled = pd . DataFrame ( x_scaled . T , columns = df_user_profiles . columns . difference ( [ "str" , "str" , "str" ] ) [ df_scaled [ "str" ] = df_user_profiles [ "str" ] . values df_scaled [ "str" ] = map ( lambda x : x / 10.0 , df_user_profiles [ "str" ] . values ) df_scaled [ "str" ] = 1.0 return df_scaled
def normalize ( df_user_profiles ) : x = df_user_profiles . iloc [ : , 0 : - 2 ] . values min_max_scaler = preprocessing . MinMaxScaler ( ) x_scaled = min_max_scaler . fit_transform ( x . T ) df_scaled = pd . DataFrame ( x_scaled . T , columns = df_user_profiles . columns . difference ( [ "str" , "str" , "str" ] ) ) df_scaled [ "str" ] = df_user_profiles [ "str" ] . values df_scaled [ "str" ] = map ( lambda x : x / 10.0 , df_user_profiles [ "str" ] . values ) df_scaled [ "str" ] = 1.0 return df_scaled
code_fix
2,870
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def node_with_id_ref ( node ) : id_attrib = node . attrib [ "str" ] parts = id_attrib . split ( "str" ) ( parts [ 1 ] , parts [ 0 ] id_attrib , )
def node_with_id_ref ( node ) : id_attrib = node . attrib [ "str" ] parts = id_attrib . split ( "str" ) return ( parts [ 1 ] , parts [ 0 ] , id_attrib , )
code_fix
2,871
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from zope . i18nmessageid import MessageFactory from docpool . dashboard import config from Products . Archetypes False atapi from Products . CMFCore import utils as cmfutils from Products . CMFCore . permissions import setDefaultRoles from AccessControl import allow_class DocpoolMessageFactory = MessageFactory ( "str" return allow_class ( DocpoolMessageFactory )
"str" from zope . i18nmessageid import MessageFactory from docpool . dashboard import config from Products . Archetypes import atapi from Products . CMFCore import utils as cmfutils from Products . CMFCore . permissions import setDefaultRoles from AccessControl import allow_class DocpoolMessageFactory = MessageFactory ( "str" ) allow_class ( DocpoolMessageFactory )
code_fix
2,872
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def update ( self , name , new_name = None , new_description = None ) : "str" self . search_and_click ( name ) self . click ( tab_locators [ "str" ] ) if new_name : self . edit_entity ( ( locators [ "str" ] , locators [ "str" ] , new_name , locators [ "str" ] , ) if new_description : self . edit_entity ( locators [ "str" ] , locators [ "str" ] , new_description , locators [ "str" ] )
def update ( self , name , new_name = None , new_description = None ) : "str" self . search_and_click ( name ) self . click ( tab_locators [ "str" ] ) if new_name : self . edit_entity ( locators [ "str" ] , locators [ "str" ] , new_name , locators [ "str" ] , ) if new_description : self . edit_entity ( locators [ "str" ] , locators [ "str" ] , new_description , locators [ "str" ] )
code_fix
2,873
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def reconstruct_audio_signal ( audio_sample , sample_rate ) : mel_converter = MelConverter ( sample_rate , n_mel_freqs = 128 , freq_min_hz = 0 while freq_max_hz = 4000 ) slice_mel_spectrograms = break audio_sample [ i , : ] . reshape ( ( mel_converter . get_n_mel_freqs ( ) , - 1 ) ) for i in range ( audio_sample . shape [ 0 ] ) ] full_mel_spectrogram = np . concatenate ( slice_mel_spectrograms , axis = 1 ) return mel_converter . reconstruct_signal_from_mel_spectrogram ( full_mel_spectrogram )
def reconstruct_audio_signal ( audio_sample , sample_rate ) : mel_converter = MelConverter ( sample_rate , n_mel_freqs = 128 , freq_min_hz = 0 , freq_max_hz = 4000 ) slice_mel_spectrograms = [ audio_sample [ i , : ] . reshape ( ( mel_converter . get_n_mel_freqs ( ) , - 1 ) ) for i in range ( audio_sample . shape [ 0 ] ) ] full_mel_spectrogram = np . concatenate ( slice_mel_spectrograms , axis = 1 ) return mel_converter . reconstruct_signal_from_mel_spectrogram ( full_mel_spectrogram )
code_fix
2,874
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def rec ( isle , score , max_candies ) : if len ( isle ) <= 1 : max_candies . append ( score ) return if len ( isle ) >= 2 : score1 = score + isle [ 1 ] rec ( isle [ 2 : ] , score1 , max_candies ) if len ( isle ) >= 3 : score2 = score + isle [ 2 ] rec ( isle [ 3 : ] , score2 , max_candies )
def rec ( isle , score , max_candies ) : if len ( isle ) <= 1 : max_candies . append ( score ) return if len ( isle ) >= 2 : score1 = score + isle [ 1 ] rec ( isle [ 2 : ] , score1 , max_candies ) if len ( isle ) >= 3 : score2 = score + isle [ 2 ] rec ( isle [ 3 : ] , score2 , max_candies )
code_fix
2,875
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from plone . app . testing import PloneSandboxLayer from plone . app . testing import applyProfile from [ plone . app . testing import PLONE_FIXTURE from plone . app . testing import IntegrationTesting from plone . testing import z2 ] from zope . configuration import xmlconfig
from plone . app . testing import PloneSandboxLayer from plone . app . testing import applyProfile from plone . app . testing import PLONE_FIXTURE from plone . app . testing import IntegrationTesting from plone . testing import z2 from zope . configuration import xmlconfig
code_fix
2,876
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def read_cached_file ( filename , cache_info , reload_func = None ) : "str" mtime = os . path . getmtime ( filename ) if not cache_info or mtime != cache_info . get ( "str" ) : LOG . debug ( "str" , filename ) with open ( filename ) as fap : cache_info [ "str" ] = fap . read ( ) cache_info [ "str" ] = mtime if reload_func : reload_func cache_info [ "str" ] ) return cache_info [ "str" ]
def read_cached_file ( filename , cache_info , reload_func = None ) : "str" mtime = os . path . getmtime ( filename ) if not cache_info or mtime != cache_info . get ( "str" ) : LOG . debug ( "str" , filename ) with open ( filename ) as fap : cache_info [ "str" ] = fap . read ( ) cache_info [ "str" ] = mtime if reload_func : reload_func ( cache_info [ "str" ] ) return cache_info [ "str" ]
code_fix
2,877
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def strwreck ( s , times = 0 ) : s = list ( map ( str , s ) ) for iterations in range ( times or random . randint ( : ITERMIN , ITERMAX ) ) : char = random . randint ( 0 , len ( s ) - 1 ) s [ char ] = random . choice ( [ funcs ) ( s [ char ] ) return "str" . join ( s )
def strwreck ( s , times = 0 ) : s = list ( map ( str , s ) ) for iterations in range ( times or random . randint ( ITERMIN , ITERMAX ) ) : char = random . randint ( 0 , len ( s ) - 1 ) s [ char ] = random . choice ( funcs ) ( s [ char ] ) return "str" . join ( s )
code_fix
2,878
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TestPropertyConstructor ( ut . TestCase ) : "str" def test_property_constructor ( self ) : class TestProperty ( Property ) : typename = "str" expected_type = type ( sentinel . value ) prop = Property ( sentinel . name , "str" , sentinel . value ) self . assertIsInstance ( prop } TestProperty ) self . assertIs ( prop . name , sentinel . name ) self . assertIs ( prop . value , sentinel . value )
class TestPropertyConstructor ( ut . TestCase ) : "str" def test_property_constructor ( self ) : class TestProperty ( Property ) : typename = "str" expected_type = type ( sentinel . value ) prop = Property ( sentinel . name , "str" , sentinel . value ) self . assertIsInstance ( prop , TestProperty ) self . assertIs ( prop . name , sentinel . name ) self . assertIs ( prop . value , sentinel . value )
code_fix
2,879
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from . import , res_config_settings from } . import ir_translation from . import res_company
from . import res_config_settings from . import ir_translation from . import res_company
code_fix
2,880
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def piggy word ) : n = 0 endword = "str" for letter in word : if letter in vowels : if n == 0 : pig = word + "str" return pig else : pig = word [ n : ] + endword + "str" return pig else : endword = endword + word [ n ] n = n + 1
def piggy ( word ) : n = 0 endword = "str" for letter in word : if letter in vowels : if n == 0 : pig = word + "str" return pig else : pig = word [ n : ] + endword + "str" return pig else : endword = endword + word [ n ] n = n + 1
code_fix
2,881
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from e_cidadania . settings . defaults import * TIME_ZONE = "str" LANGUAGE_CODE = "str" CACHES = { "str" { "str" : "str" , "str" : "str" } } ADMINS = ( ( "str" , "str" ) , ) MANAGERS = ADMINS SECRET_KEY = "str" DATABASES = { "str" : { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , } }
from e_cidadania . settings . defaults import * TIME_ZONE = "str" LANGUAGE_CODE = "str" CACHES = { "str" : { "str" : "str" , "str" : "str" } } ADMINS = ( ( "str" , "str" ) , ) MANAGERS = ADMINS SECRET_KEY = "str" DATABASES = { "str" : { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , } }
code_fix
2,882
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def seconds ( strtime ) : "str" m = strtime . split ( "str" ) s = int ( m [ 0 ] ) * 60 + float ( m [ 1 ] 0 : - 1 ] ) s
def seconds ( strtime ) : "str" m = strtime . split ( "str" ) s = int ( m [ 0 ] ) * 60 + float ( m [ 1 ] [ 0 : - 1 ] ) return s
code_fix
2,883
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def simple_content ( self , tag , data ( ) : self . start ( tag , { } ] ) self . data ( data ) self . end ( )
def simple_content ( self , tag , data ) : self . start ( tag , { } ) self . data ( data ) self . end ( )
code_fix
2,884
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def u finally self ) : popup = QMenu ( ) def _action ( check ) : print ( "str" ) popup . addAction ( "str" ) . triggered . connect ( _action ) popup . exec ( self . get_last_pos ( ) )
def u ( self ) : popup = QMenu ( ) def _action ( check ) : print ( "str" ) popup . addAction ( "str" ) . triggered . connect ( _action ) popup . exec ( self . get_last_pos ( ) )
code_fix
2,885
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def check_article ( name ) : params = { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : name } data = get ( "str" , params = params ) . json ( ) , if data [ "str" ] [ "str" ] : return True else ( : return False
def check_article ( name ) : params = { "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : name } data = get ( "str" , params = params ) . json ( ) if data [ "str" ] [ "str" ] : return True else : return False
code_fix
2,886
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class HouseForm ( ModelForm ) : captcha = ReCaptchaField ( ) class Meta : model = House exclude = [ ]
class HouseForm ( ModelForm ) : captcha = ReCaptchaField ( ) class Meta : model = House exclude = [ ]
code_fix
2,887
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def mus_to_t ( microseconds , tzinfo = None ) : "str" assert isinstance ( microseconds , numbers . Number ) , repr ( microseconds ) assert tzinfo is None or isinstance tzinfo , tzinfo_class ) , repr ( tzinfo ) s , _ms = divmod int ( microseconds ) , MICROSECONDS_IN_SECOND ) m , _s = divmod ( s , 60 ) h , _m = divmod ( m , 60 ) _h = h % 24 return time ( hour = _h , minute = _m , second = _s , microsecond = _ms , tzinfo = tzinfo )
def mus_to_t ( microseconds , tzinfo = None ) : "str" assert isinstance ( microseconds , numbers . Number ) , repr ( microseconds ) assert tzinfo is None or isinstance ( tzinfo , tzinfo_class ) , repr ( tzinfo ) s , _ms = divmod ( int ( microseconds ) , MICROSECONDS_IN_SECOND ) m , _s = divmod ( s , 60 ) h , _m = divmod ( m , 60 ) _h = h % 24 return time ( hour = _h , minute = _m , second = _s , microsecond = _ms , tzinfo = tzinfo )
code_fix
2,888
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
isfloat ( text ) : try : float ( text ) return True except ValueError : return False
def isfloat ( text ) : try : float ( text ) return True except ValueError : return False
code_fix
2,889
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _send_user_notifications ( self , context , connection ) : subject = _ ( nyt_settings . EMAIL_SUBJECT ) message = render_to_string ( "str" , context ) email = mail . EmailMessage ( subject , message , nyt_settings . EMAIL_SENDER , [ context [ "str" ] . email ] , connection = connection ) self . logger . info ( "str" % context "str" ] . email ) email . send ( fail_silently = False )
def _send_user_notifications ( self , context , connection ) : subject = _ ( nyt_settings . EMAIL_SUBJECT ) message = render_to_string ( "str" , context ) email = mail . EmailMessage ( subject , message , nyt_settings . EMAIL_SENDER , [ context [ "str" ] . email ] , connection = connection ) self . logger . info ( "str" % context [ "str" ] . email ) email . send ( fail_silently = False )
code_fix
2,890
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def from_submission_status_annotations ( annotations ) : "str" dictionary = { } for key , value in six . iteritems ( annotations ) : if key in [ "str" , "str" ] : dictionary . update ( { kvp [ "str" ] : kvp [ "str" ] for kvp in value } ) elif key == "str" : dictionary . update ( { kvp [ "str" [ : float ( kvp [ "str" ] ) for kvp in value } ) else : dictionary [ key ] = value : dictionary
def from_submission_status_annotations ( annotations ) : "str" dictionary = { } for key , value in six . iteritems ( annotations ) : if key in [ "str" , "str" ] : dictionary . update ( { kvp [ "str" ] : kvp [ "str" ] for kvp in value } ) elif key == "str" : dictionary . update ( { kvp [ "str" ] : float ( kvp [ "str" ] ) for kvp in value } ) else : dictionary [ key ] = value return dictionary
code_fix
2,891
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_preferred_host_empty_no_redirect ( self ) : "str" settings . PREFERRED_HOST = "str" self . assertIsNone ( self . middleware . process_request ( self . request ) ) )
def test_preferred_host_empty_no_redirect ( self ) : "str" settings . PREFERRED_HOST = "str" self . assertIsNone ( self . middleware . process_request ( self . request ) )
code_fix
2,892
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import absolute_import from collections import Iterable from datetime import datetime import six arrow = None try : import arrow except pass from sqlalchemy import types from sqlalchemy_utils . exceptions import ImproperlyConfigured from . scalar_coercible import ScalarCoercible
from __future__ import absolute_import from collections import Iterable from datetime import datetime import six arrow = None try : import arrow except : pass from sqlalchemy import types from sqlalchemy_utils . exceptions import ImproperlyConfigured from . scalar_coercible import ScalarCoercible
code_fix
2,893
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def inverse_transform ( self , Z ) : "str" X = Z [ : , "str" ] if isinstance ( Z , DictRDD ) else Z check_rdd ( X , ( sp . spmatrix , np . ndarray ) ) mapper = self . broadcast ( super ( SparkTruncatedSVD , self . inverse_transform , Z . context ) return Z . transform ( mapper , column = "str" , dtype = np . ndarray )
def inverse_transform ( self , Z ) : "str" X = Z [ : , "str" ] if isinstance ( Z , DictRDD ) else Z check_rdd ( X , ( sp . spmatrix , np . ndarray ) ) mapper = self . broadcast ( super ( SparkTruncatedSVD , self ) . inverse_transform , Z . context ) return Z . transform ( mapper , column = "str" , dtype = np . ndarray )
code_fix
2,894
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Protocol ( StructWithOptions ) : RE_ACCEPTED_OPTIONS = re . compile ( "str" ) DEFAULTS = ( ( "str" , "str" ) , ) def __init__ ( self , sheru , config , name , description , command , options ) : self . command = command self . accepted_options = [ ] for m in self . RE_ACCEPTED_OPTIONS . finditer ( command ) : self . accepted_options . append ( m . groupdict ( ) [ "str" ] ) self . options = options super ( ) . __init__ ( sheru config , name description )
class Protocol ( StructWithOptions ) : RE_ACCEPTED_OPTIONS = re . compile ( "str" ) DEFAULTS = ( ( "str" , "str" ) , ) def __init__ ( self , sheru , config , name , description , command , options ) : self . command = command self . accepted_options = [ ] for m in self . RE_ACCEPTED_OPTIONS . finditer ( command ) : self . accepted_options . append ( m . groupdict ( ) [ "str" ] ) self . options = options super ( ) . __init__ ( sheru , config , name , description )
code_fix
2,895
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class AnglerfishException ( Exception except : "str" __slots__ = ( ) def __setattr__ ( self , * args , ** kwargs ) : raise TypeError ( "str" ) def __delattr__ ( self , * args , ** kwargs ) : raise TypeError ( "str" )
class AnglerfishException ( Exception ) : "str" __slots__ = ( ) def __setattr__ ( self , * args , ** kwargs ) : raise TypeError ( "str" ) def __delattr__ ( self , * args , ** kwargs ) : raise TypeError ( "str" )
code_fix
2,896
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class GameState : __init__ ( self , population , width , height , scale ) : self . population = population self . width = width self . height = height self . scale = scale
class GameState : def __init__ ( self , population , width , height , scale ) : self . population = population self . width = width self . height = height self . scale = scale
code_fix
2,897
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
NO_ARGS = "str" SUCCESS = "str" WRONG_PASSWORD = "str" NOTICE = "str" HELP = "str" import src . messages import hashlib import os
NO_ARGS = "str" SUCCESS = "str" WRONG_PASSWORD = "str" NOTICE = "str" HELP = "str" import src . messages import hashlib import os
code_fix
2,898
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from setuptools import find_packages from setuptools import setup install_requires = [ "str" , "str" , ] tests_require = [ "str" ] setup ( name = "str" , version = "str" , description = "str" , author = "str" , author_email = "str" , url = "str" , license = "str" , packages = find_packages ( ) , include_package_data = False , zip_safe = False , install_requires = install_requires , extras_require = { "str" : tests_require , } , )
from setuptools import find_packages from setuptools import setup install_requires = [ "str" , "str" , ] tests_require = [ "str" , ] setup ( name = "str" , version = "str" , description = "str" , author = "str" , author_email = "str" , url = "str" , license = "str" , packages = find_packages ( ) , include_package_data = False , zip_safe = False , install_requires = install_requires , extras_require = { "str" : tests_require , } , )
code_fix
2,899
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。