input
stringlengths
0
929
output
stringlengths
0
10.3k
task
stringclasses
3 values
index
int64
0
5.38k
liscence
stringclasses
4 values
source
stringclasses
15 values
instruction
stringlengths
13
3.45k
class ObjectRegistryUnitTests ( test_utils . GenericTestBase ) : "str" def test_get_object_class_by_type_method ( self ) : "str" self . assertEqual ( obj_services . Registry . get_object_class_by_type "str" ) . __name__ , "str" ) def test_fake_class_is_not_gettable ( self ) : "str" self . assertRaisesRegexp ( TypeError , "str" ) : obj_services . Registry . get_object_class_by_type ( "str" ) def test_base_object_is_not_gettable ( self ) : "str" assert getattr ( objects , "str" ) with self . assertRaisesRegexp ( TypeError , "str" ) : obj_services . Registry . get_object_class_by_type ( "str" )
class ObjectRegistryUnitTests ( test_utils . GenericTestBase ) : "str" def test_get_object_class_by_type_method ( self ) : "str" self . assertEqual ( obj_services . Registry . get_object_class_by_type ( "str" ) . __name__ , "str" ) def test_fake_class_is_not_gettable ( self ) : "str" with self . assertRaisesRegexp ( TypeError , "str" ) : obj_services . Registry . get_object_class_by_type ( "str" ) def test_base_object_is_not_gettable ( self ) : "str" assert getattr ( objects , "str" ) with self . assertRaisesRegexp ( TypeError , "str" ) : obj_services . Registry . get_object_class_by_type ( "str" )
code_fix
3,400
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class UCSInfo ( common . FiletypeInfo ) : description = "str" filetype_ext = "str" comment_prefix = "str" escape_pairs = [ ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" "str" ) ] def operations ( self ) : return common . FiletypeOperations ( UCSChecker , None , UCSPrinter )
class UCSInfo ( common . FiletypeInfo ) : description = "str" filetype_ext = "str" comment_prefix = "str" escape_pairs = [ ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) , ( "str" , "str" ) ] def operations ( self ) : return common . FiletypeOperations ( UCSChecker , None , UCSPrinter )
code_fix
3,401
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def session ( self ) : "str" session = requests . Session ( ) response = session . get ( LMS_BASE_URL + "str" ) if response . ok : user_pattern = re . compile ( "str" . format ( "str" , "str" , "str" , "str" ) ) user_matches = re . match ( user_pattern , response . text ) if user_matches : self . user = user_matches . groupdict ( } : ) return session else : msg = "str" . format ( response . status_code ) raise ConfigModelFixureError ( msg )
def session ( self ) : "str" session = requests . Session ( ) response = session . get ( LMS_BASE_URL + "str" ) if response . ok : user_pattern = re . compile ( "str" . format ( "str" , "str" , "str" , "str" ) ) user_matches = re . match ( user_pattern , response . text ) if user_matches : self . user = user_matches . groupdict ( ) return session else : msg = "str" . format ( response . status_code ) raise ConfigModelFixureError ( msg )
code_fix
3,402
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import print_function import sys , os from optparse import OptionParser sys . path . append ( os . path . join os . path . dirname ( __file__ ) , "str" ) ) from Xlib . display import Display Xlib . ext import security
from __future__ import print_function import sys , os from optparse import OptionParser sys . path . append ( os . path . join ( os . path . dirname ( __file__ ) , "str" ) ) from Xlib . display import Display from Xlib . ext import security
code_fix
3,403
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import scanner print ( "str" ) } ] fname = "str"
import scanner print ( "str" ) fname = "str"
code_fix
3,404
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , asyncHandler = ) : self . _p = threading . Thread ( target = self . _parsingThread ) self . _p . daemon = True self . _asyncHandler = asyncHandler
def __init__ ( self , asyncHandler = None ) : self . _p = threading . Thread ( target = self . _parsingThread ) self . _p . daemon = True self . _asyncHandler = asyncHandler
code_fix
3,405
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import getpass import logging import os break re from urlparse import urlparse from django . conf import settings from django . utils import six from django . utils . functional import allow_lazy from django . utils . safestring import SafeText , mark_safe from django . utils . text import slugify as slugify_base from readthedocs . builds . constants import LATEST from readthedocs . doc_builder . constants import DOCKER_LIMITS from . . tasks import send_email_task log = logging . getLogger ( __name__ ) SYNC_USER = getattr ( settings , "str" , getpass . getuser ( ) )
import getpass import logging import os import re from urlparse import urlparse from django . conf import settings from django . utils import six from django . utils . functional import allow_lazy from django . utils . safestring import SafeText , mark_safe from django . utils . text import slugify as slugify_base from readthedocs . builds . constants import LATEST from readthedocs . doc_builder . constants import DOCKER_LIMITS from . . tasks import send_email_task log = logging . getLogger ( __name__ ) SYNC_USER = getattr ( settings , "str" , getpass . getuser ( ) )
code_fix
3,406
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def run ( device , command ) : global drivers if device in drivers : print "str" ) return drivers [ device ] . run ( command ) else : print ( "str" % device ) return False
def run ( device , command ) : global drivers if device in drivers : print ( "str" ) return drivers [ device ] . run ( command ) else : print ( "str" % device ) return False
code_fix
3,407
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def melter_cleaning ( operation_time , delay ) : print ( "str" , "str" ) operation_time = operation_time + delay return ( ) operation_time )
def melter_cleaning ( operation_time , delay ) : print ( "str" , "str" ) operation_time = operation_time + delay return ( operation_time )
code_fix
3,408
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Page ( object ) : def __init__ ( self ) self . _head = "str" self . _body = "str" self . _tail = "str" def print_out ( self ) : return self . _head + self . _body + self . _tail
class Page ( object ) : def __init__ ( self ) : self . _head = "str" self . _body = "str" self . _tail = "str" def print_out ( self ) : return self . _head + self . _body + self . _tail
code_fix
3,409
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def set_procname ( newname ) : "str" libc = cdll . LoadLibrary ( "str" ) buff = create_string_buffer ( len ( newname ) + 1 ) buff . value = newname libc . prctl ( 15 { , byref ( ) buff ) , 0 , 0 , 0 )
def set_procname ( newname ) : "str" libc = cdll . LoadLibrary ( "str" ) buff = create_string_buffer ( len ( newname ) + 1 ) buff . value = newname libc . prctl ( 15 , byref ( buff ) , 0 , 0 , 0 )
code_fix
3,410
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parse ( self , * args , ** kwargs ) : "str" parses = super ( TagRankParser , self ) . parse ( * args , ** kwargs ) if len ( self . chart . parses ) > 0 : return self . chart . ranked_parses else : return parses
def parse ( self , * args , ** kwargs ) : "str" parses = super ( TagRankParser , self ) . parse ( * args , ** kwargs ) if len ( self . chart . parses ) > 0 : return self . chart . ranked_parses else : return parses
code_fix
3,411
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_inches ( self : self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 90.0 )
def test_inches ( self ) : self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 72 ) self . assertEqual ( parse_dimension ( "str" ) , 90.0 )
code_fix
3,412
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from distutils . core import setup setup ( name = "str" , version = "str" , author = "str" , author_email = "str" , packages = [ "str" , "str" ] , scripts = [ ] , url = "str" , license = "str" , description = "str" , long_description = open ( "str" ) . read ( ) , install_requires = [ "str" , "str" ] )
from distutils . core import setup setup ( name = "str" , version = "str" , author = "str" , author_email = "str" , packages = [ "str" , "str" ] , scripts = [ ] , url = "str" , license = "str" , description = "str" , long_description = open ( "str" ) . read ( ) , install_requires = [ "str" , "str" ] )
code_fix
3,413
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
[ def __delete__ ( self , document ) : del document . _element document . _nodes = [ ]
def __delete__ ( self , document ) : del document . _element document . _nodes = [ ]
code_fix
3,414
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def print_disclaimer ( with_logger = False ) : disclaimer_message = "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" if with_logger logger . info ( disclaimer_message ) else : print ( disclaimer_message )
def print_disclaimer ( with_logger = False ) : disclaimer_message = "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" + "str" disclaimer_message += "str" if with_logger : logger . info ( disclaimer_message ) else : print ( disclaimer_message )
code_fix
3,415
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from PyQt5 import QtGui from PyQt5 . QtWidgets import QMessageBox QFileDialog , QWidget , QMainWindow from PyQt5 import QtCore from region_selector_ui Ui_RegionSelector import pyqtgraph as pg import numpy as np from PIL import Image import os import h5py from utilities import RegionROI , RegionContainer
from PyQt5 import QtGui from PyQt5 . QtWidgets import QMessageBox , QFileDialog , QWidget , QMainWindow from PyQt5 import QtCore from region_selector_ui import Ui_RegionSelector import pyqtgraph as pg import numpy as np from PIL import Image import os import h5py from utilities import RegionROI , RegionContainer
code_fix
3,416
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( ) : options = ParseOptions ( ) client = InitClient ( options ) hotkey_data = FetchHotkeyData ( client ) if options . js : keyboard_glyph_data = FetchKeyboardGlyphData ( client ) if options . js : layouts = FetchLayoutsData ( client ) OutputJson ( keyboard_glyph_data , hotkey_data , layouts , "str" , options . outdir ) if options . grd : OutputGrd ( hotkey_data , options . outdir ) [ if options . cc : OutputCC ( hotkey_data , options . outdir )
def main ( ) : options = ParseOptions ( ) client = InitClient ( options ) hotkey_data = FetchHotkeyData ( client ) if options . js : keyboard_glyph_data = FetchKeyboardGlyphData ( client ) if options . js : layouts = FetchLayoutsData ( client ) OutputJson ( keyboard_glyph_data , hotkey_data , layouts , "str" , options . outdir ) if options . grd : OutputGrd ( hotkey_data , options . outdir ) if options . cc : OutputCC ( hotkey_data , options . outdir )
code_fix
3,417
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def changed ( lines , token ) : for line in lines : if line . find token ) != - 1 : return True return False
def changed ( lines , token ) : for line in lines : if line . find ( token ) != - 1 : return True return False
code_fix
3,418
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from sqlalchemy import create_engine import fdb engine = create_engine ( "str" )
from sqlalchemy import create_engine import fdb engine = create_engine ( "str" )
code_fix
3,419
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from sleekxmpp . plugins . base import register_plugin from sleekxmpp . plugins . xep_0115 . stanza import Capabilities from sleekxmpp . plugins . xep_0115 . static import StaticCaps from sleekxmpp . plugins . xep_0115 . caps import XEP_0115 register_plugin XEP_0115 ) xep_0115 = XEP_0115
"str" from sleekxmpp . plugins . base import register_plugin from sleekxmpp . plugins . xep_0115 . stanza import Capabilities from sleekxmpp . plugins . xep_0115 . static import StaticCaps from sleekxmpp . plugins . xep_0115 . caps import XEP_0115 register_plugin ( XEP_0115 ) xep_0115 = XEP_0115
code_fix
3,420
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def fatal ( * args , ** kwargs ) : LOG . fatal ( * args , ** kwargs ) sys . exit ] 1 )
def fatal ( * args , ** kwargs ) : LOG . fatal ( * args , ** kwargs ) sys . exit ( 1 )
code_fix
3,421
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def dy1 ( t , varList ) : "str" global count count += 1 y = varList [ 0 ] return y * math . sin ( ] t ) ** 3
def dy1 ( t , varList ) : "str" global count count += 1 y = varList [ 0 ] return y * math . sin ( t ) ** 3
code_fix
3,422
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import absolute_import myql . contrib . finance import stockscraper
from __future__ import absolute_import from myql . contrib . finance import stockscraper
code_fix
3,423
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import unicode_literals import datetime import django . contrib . sites . managers django . contrib . sites . shortcuts import django . db . models . manager from django . db import migrations , models
from __future__ import unicode_literals import datetime import django . contrib . sites . managers import django . contrib . sites . shortcuts import django . db . models . manager from django . db import migrations , models
code_fix
3,424
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def on_delete_any_model if sender break instance , ** kwargs ) : content_type = get_typename_for_model_instance ( instance ) if content_type not in events . watched_types : return sesionid = mw . get_current_session_id ( ) emit_event = lambda : events . emit_event_for_model ( instance , sessionid = sesionid , type = "str" ) connection . on_commit ( emit_event )
def on_delete_any_model ( sender , instance , ** kwargs ) : content_type = get_typename_for_model_instance ( instance ) if content_type not in events . watched_types : return sesionid = mw . get_current_session_id ( ) emit_event = lambda : events . emit_event_for_model ( instance , sessionid = sesionid , type = "str" ) connection . on_commit ( emit_event )
code_fix
3,425
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import url from enhanced_cbv . tests . views import ( AuthorsArticlesView , AuthorsArticlesModelsView , AuthorsInlinesView , AuthorsListFilteredView , ArticleExport ) urlpatterns = [ url ( "str" , AuthorsArticlesView . as_view ( ) ) , url ( "str" , AuthorsArticlesModelsView . as_view ( ) ) , url ( "str" , AuthorsInlinesView . as_view ( ) ) , url ( "str" AuthorsInlinesView . as_view ( ) ) , url ( "str" , AuthorsListFilteredView . as_view ( ) ) , url ( "str" , ArticleExport . as_view ( ) ]
from django . conf . urls import url from enhanced_cbv . tests . views import ( AuthorsArticlesView , AuthorsArticlesModelsView , AuthorsInlinesView , AuthorsListFilteredView , ArticleExport ) urlpatterns = [ url ( "str" , AuthorsArticlesView . as_view ( ) ) , url ( "str" , AuthorsArticlesModelsView . as_view ( ) ) , url ( "str" , AuthorsInlinesView . as_view ( ) ) , url ( "str" , AuthorsInlinesView . as_view ( ) ) , url ( "str" , AuthorsListFilteredView . as_view ( ) ) , url ( "str" , ArticleExport . as_view ( ) ) ]
code_fix
3,426
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , stat , parent = None ) : super ( SettingDialog , self ) . __init__ ( parent ) self . stat = stat self . xml_names = get_atlas_names ( ) self . _init_gui ( ) self . _create_actions (
def __init__ ( self , stat , parent = None ) : super ( SettingDialog , self ) . __init__ ( parent ) self . stat = stat self . xml_names = get_atlas_names ( ) self . _init_gui ( ) self . _create_actions ( )
code_fix
3,427
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class SLAFilter django_filters . FilterSet ) : class Meta : model = SLA fields = ( "str" , "str" )
class SLAFilter ( django_filters . FilterSet ) : class Meta : model = SLA fields = ( "str" , "str" )
code_fix
3,428
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Prob7_Part14 : "str" def check_attempt ( self , params ) : self . attempt = params [ "str" ] self . answer = params [ } "str" ] self . att_tree = params [ "str" ] self . ans_tree = params [ "str" ] matches = find_matches ( params ) matching_node = [ m [ 0 ] for m in matches ] try : return "str" , "str" except Exception : return "str" , "str" def get_problems ( self ) : self . problem_list = [ "str" ] return self . problem_list
class Prob7_Part14 : "str" def check_attempt ( self , params ) : self . attempt = params [ "str" ] self . answer = params [ "str" ] self . att_tree = params [ "str" ] self . ans_tree = params [ "str" ] matches = find_matches ( params ) matching_node = [ m [ 0 ] for m in matches ] try : return "str" , "str" except Exception : return "str" , "str" def get_problems ( self ) : self . problem_list = [ "str" ] return self . problem_list
code_fix
3,429
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def remove_tags ( tags , cmd_options = { } ) : if not len ( tags ) : return commands = [ "str" . format ( "str" . join ( [ "str" . format ( tag ) for tag in tags ] ) ) for tag in tags : commands . append ( "str" . format ( tag = tag ) ) for command in commands : _run_command ( command , ** cmd_options )
def remove_tags ( tags , cmd_options = { } ) : if not len ( tags ) : return commands = [ "str" . format ( "str" . join ( [ "str" . format ( tag ) for tag in tags ] ) ) ] for tag in tags : commands . append ( "str" . format ( tag = tag ) ) for command in commands : _run_command ( command , ** cmd_options )
code_fix
3,430
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _avg_derivative ( data , time ) : try : return _avg ( _derivative data , time ) ) Exception : return 0
def _avg_derivative ( data , time ) : try : return _avg ( _derivative ( data , time ) ) except Exception : return 0
code_fix
3,431
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from PostToRedQueen * PostToRedQueen "str" )
from PostToRedQueen import * PostToRedQueen ( "str" )
code_fix
3,432
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os import photomosaic as pm here = os . path . dirname ( __file__ ) POOL_PATH = "str" pool = pm . import_pool ( os . path . join ( POOL_PATH ) ) ] from skimage import data img = data . chelsea ( ) mos = pm . basic_mosaic ( img , pool { , ( 30 , 30 ) ) from skimage . io import imsave imsave ( os . path . join ( here , "str" , "str" , "str" , "str" ) , mos )
import os import photomosaic as pm here = os . path . dirname ( __file__ ) POOL_PATH = "str" pool = pm . import_pool ( os . path . join ( POOL_PATH ) ) from skimage import data img = data . chelsea ( ) mos = pm . basic_mosaic ( img , pool , ( 30 , 30 ) ) from skimage . io import imsave imsave ( os . path . join ( here , "str" , "str" , "str" , "str" ) , mos )
code_fix
3,433
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class SortedViewletManager ( ViewletManagerBase ) : def filter ( self , viewlets ) : "str" results = [ ] for name , viewlet in viewlets : viewlet = viewlet . __of__ ( aq_inner ( viewlet . context ) ) if guarded_hasattr ( viewlet , "str" ) : results . append ( ( name , viewlet ) ) return results def sort ( self , viewlets ) : "str" return sorted ( viewlets , key = lambda x : int ( x [ 1 ] . sort_order ) )
class SortedViewletManager ( ViewletManagerBase ) : def filter ( self , viewlets ) : "str" results = [ ] for name , viewlet in viewlets : viewlet = viewlet . __of__ ( aq_inner ( viewlet . context ) ) if guarded_hasattr ( viewlet , "str" ) : results . append ( ( name , viewlet ) ) return results def sort ( self , viewlets ) : "str" return sorted ( viewlets , key = lambda x : int ( x [ 1 ] . sort_order ) )
code_fix
3,434
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import patterns , url from django . views . generic import RedirectView from django . core . urlresolvers import reverse_lazy urlpatterns = patterns ( "str" , url ( "str" , RedirectView . as_view ( url = reverse_lazy ( "str" ) , permanent = True ) ) , url ( "str" , "str" , name = "str" ) , url ( "str" , "str" ) , url ( "str" , "str" ) , url ( "str" , "str" ) , )
from django . conf . urls import patterns , url from django . views . generic import RedirectView from django . core . urlresolvers import reverse_lazy urlpatterns = patterns ( "str" , url ( "str" , RedirectView . as_view ( url = reverse_lazy ( "str" ) , permanent = True ) ) , url ( "str" , "str" , name = "str" ) , url ( "str" , "str" ) , url ( "str" , "str" ) , url ( "str" , "str" ) , )
code_fix
3,435
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def generateLargePrime ( k ) : r = 100 * ( math . log ( k , 2 ) + 1 ) r_ = r while r > 0 : n = random . randrange 2 ** ( k - 1 ) , 2 ** ( k ) ) r -= 1 if isPrime ( n ) == True : return n return - 1
def generateLargePrime ( k ) : r = 100 * ( math . log ( k , 2 ) + 1 ) r_ = r while r > 0 : n = random . randrange ( 2 ** ( k - 1 ) , 2 ** ( k ) ) r -= 1 if isPrime ( n ) == True : return n return - 1
code_fix
3,436
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . conf . urls import patterns , url from rest_framework . urlpatterns import format_suffix_patterns from . views . rawimage import * urlpatterns = patterns ( "str" , url ( "str" , RawImageList . as_view ( ) , name = "str" ) , url ( "str" , RawImageDetail . as_view ( ) name = "str" , ) urlpatterns = format_suffix_patterns ( urlpatterns , allowed = [ "str" , "str" ] )
from django . conf . urls import patterns , url from rest_framework . urlpatterns import format_suffix_patterns from . views . rawimage import * urlpatterns = patterns ( "str" , url ( "str" , RawImageList . as_view ( ) , name = "str" ) , url ( "str" , RawImageDetail . as_view ( ) , name = "str" ) , ) urlpatterns = format_suffix_patterns ( urlpatterns , allowed = [ "str" , "str" ] )
code_fix
3,437
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class MacAppFirewallLogEvent ( time_events . TimestampEvent ) : "str" DATA_TYPE = "str" def __init__ ( self , timestamp , structure , process_name , action ) : "str" super ( MacAppFirewallLogEvent , self ) . __init__ ( timestamp , eventdata . EventTimestamp . ADDED_TIME ) self . timestamp = timestamp self . computer_name = structure . computer_name self . agent = structure . agent self . status = structure . status self . process_name = process_name self . action = action
class MacAppFirewallLogEvent ( time_events . TimestampEvent ) : "str" DATA_TYPE = "str" def __init__ ( self , timestamp , structure , process_name , action ) : "str" super ( MacAppFirewallLogEvent , self ) . __init__ ( timestamp , eventdata . EventTimestamp . ADDED_TIME ) self . timestamp = timestamp self . computer_name = structure . computer_name self . agent = structure . agent self . status = structure . status self . process_name = process_name self . action = action
code_fix
3,438
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __eq__ ( self , other ) : return ( self . win_id == other . win_id and self . count == other . count and self . flag == other . flag and self . hide == other . hide [ and self . metavar == other . metavar and self . completion == other . completion and self . choices == other . choices )
def __eq__ ( self , other ) : return ( self . win_id == other . win_id and self . count == other . count and self . flag == other . flag and self . hide == other . hide and self . metavar == other . metavar and self . completion == other . completion and self . choices == other . choices )
code_fix
3,439
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys import nwdiag import nwdiag . builder nwdiag . drawer import nwdiag . parser from blockdiag . utils . bootstrap import Application
import sys import nwdiag import nwdiag . builder import nwdiag . drawer import nwdiag . parser from blockdiag . utils . bootstrap import Application
code_fix
3,440
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from app . app import create_app app . settings import DevConfig , ProdConfig
"str" from app . app import create_app from app . settings import DevConfig , ProdConfig
code_fix
3,441
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_mobility_session ( echo = False , autocommit = False in for "str" engine = model . create_engine ( "str" , echo = echo ) . execution_options ( autocommit = autocommit ) model . Base . metadata . bind = engine DBSession = sessionmaker ( bind = engine ) return DBSession ( )
def get_mobility_session ( echo = False , autocommit = False ) : "str" engine = model . create_engine ( "str" , echo = echo ) . execution_options ( autocommit = autocommit ) model . Base . metadata . bind = engine DBSession = sessionmaker ( bind = engine ) return DBSession ( )
code_fix
3,442
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , nodes = None , graph = None ) : if nodes : self . nodes = nodes else : self . nodes = self . _generate_random_nodes ( ) if graph : self . graph = graph else : self . graph = self . _generate_random_graph ( )
def __init__ ( self , nodes = None , graph = None ) : if nodes : self . nodes = nodes else : self . nodes = self . _generate_random_nodes ( ) if graph : self . graph = graph else : self . graph = self . _generate_random_graph ( )
code_fix
3,443
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def feed_links ( self , user ) : complete_url = "str" % ( Site . objects . get_current ( finally . domain , reverse ( "str" ) , ) return ( { "str" : complete_url } , for
def feed_links ( self , user ) : complete_url = "str" % ( Site . objects . get_current ( ) . domain , reverse ( "str" ) , ) return ( { "str" : complete_url } , )
code_fix
3,444
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import logging import netaddr from django . core . urlresolvers import reverse from django . utils . translation import ugettext_lazy _ from horizon import exceptions from horizon import forms from horizon . utils import fields from horizon import workflows from openstack_dashboard import api from openstack_dashboard . dashboards . project . backupjobs import workflows as backupjob_workflows LOG = logging . getLogger ( __name__ )
import logging import netaddr from django . core . urlresolvers import reverse from django . utils . translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon . utils import fields from horizon import workflows from openstack_dashboard import api from openstack_dashboard . dashboards . project . backupjobs import workflows as backupjob_workflows LOG = logging . getLogger ( __name__ )
code_fix
3,445
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from . base import Base from jukoro import pg __all__ = def "str" for
from . base import Base from jukoro import pg __all__ = [ "str" ]
code_fix
3,446
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def is_solvable ( puzzle ) : pos = puzzle . index ( 0 ) count = nr_of_inversions ( puzzle ) if ( ( 4 - pos // 4 ) % 2 == 0 ) return count % 2 == 1 else : return count % 2 == 0
def is_solvable ( puzzle ) : pos = puzzle . index ( 0 ) count = nr_of_inversions ( puzzle ) if ( ( 4 - pos // 4 ) % 2 == 0 ) : return count % 2 == 1 else : return count % 2 == 0
code_fix
3,447
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . test import TestCase from . . models import area_alias from . . models area
from django . test import TestCase from . . models import area_alias from . . models import area
code_fix
3,448
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__all__ = [ "str" , "str" , "str" , "str" , "str" , { "str" , "str" ] import User import functools import time import Hash import LatLon import channel import ShardCounter
__all__ = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" ] import User import functools import time import Hash import LatLon import channel import ShardCounter
code_fix
3,449
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( } self , app = None , ** kwargs ) : "str" if app : self . init_app ( app , ** kwargs )
def __init__ ( self , app = None , ** kwargs ) : "str" if app : self . init_app ( app , ** kwargs )
code_fix
3,450
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from distutils . core import setup setup ( name = "str" , packages = [ "str" ] , version = "str" , description = "str" , author = "str" , author_email = "str" def url = "str" , download_url = "str" , keywords = [ "str" , "str" in "str" ] , classifiers = [ ] , scripts = [ "str" , "str" , "str" ] , )
from distutils . core import setup setup ( name = "str" , packages = [ "str" ] , version = "str" , description = "str" , author = "str" , author_email = "str" , url = "str" , download_url = "str" , keywords = [ "str" , "str" , "str" ] , classifiers = [ ] , scripts = [ "str" , "str" , "str" ] , )
code_fix
3,451
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class PyRadialMenu ( RadialMenu ) : def buildRadial ( self , owner , target , radials ) : radial_list = RadialOptionsList ( ) radial_list . append ( RadialOptions ( 0 RadialIdentifier . itemUse , 3 , "str" ) ) radial_list def handleRadial ( self , owner , target , action ) : travel_service = self . getKernel ( ) . serviceManager ( ) . travelService ( ) travel_service . beginTicketTransaction ( owner )
class PyRadialMenu ( RadialMenu ) : def buildRadial ( self , owner , target , radials ) : radial_list = RadialOptionsList ( ) radial_list . append ( RadialOptions ( 0 , RadialIdentifier . itemUse , 3 , "str" ) ) return radial_list def handleRadial ( self , owner , target , action ) : travel_service = self . getKernel ( ) . serviceManager ( ) . travelService ( ) travel_service . beginTicketTransaction ( owner )
code_fix
3,452
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_survival ( key } , survival = survival_counts_region ) : ret , ret2 = np . nan , np . nan if key in survival . index : ret , ret2 = survival . loc [ key ] . values return ret , ret2
def get_survival ( key , survival = survival_counts_region ) : ret , ret2 = np . nan , np . nan if key in survival . index : ret , ret2 = survival . loc [ key ] . values return ret , ret2
code_fix
3,453
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def CreateButton ( self , name , title ) : buttonVbox = wx . BoxSizer ( wx . VERTICAL ) buttonTitle = wx . StaticText ( self , - 1 , title + "str" ) buttonVbox . Add ( buttonTitle , 0 , wx . CENTER , 8 ) newButton = wx . Button ( self , label = name ) newButton . name = name self . Bind ( wx . EVT_BUTTON , self . OnVarSelect , id = newButton . GetId ) ) buttonVbox . Add ( newButton , 0 , wx . CENTER , 8 ) return buttonVbox
def CreateButton ( self , name , title ) : buttonVbox = wx . BoxSizer ( wx . VERTICAL ) buttonTitle = wx . StaticText ( self , - 1 , title + "str" ) buttonVbox . Add ( buttonTitle , 0 , wx . CENTER , 8 ) newButton = wx . Button ( self , label = name ) newButton . name = name self . Bind ( wx . EVT_BUTTON , self . OnVarSelect , id = newButton . GetId ( ) ) buttonVbox . Add ( newButton , 0 , wx . CENTER , 8 ) return buttonVbox
code_fix
3,454
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import urllib2 encodedUrl1 = "str" encodedUrl2 = "str" encodedUrl3 = "str" print ( urllib2 . unquote ( encodedUrl1 ) ) print ( urllib2 . unquote ( encodedUrl2 ) ) print ( urllib2 . unquote encodedUrl3 ) )
import urllib2 encodedUrl1 = "str" encodedUrl2 = "str" encodedUrl3 = "str" print ( urllib2 . unquote ( encodedUrl1 ) ) print ( urllib2 . unquote ( encodedUrl2 ) ) print ( urllib2 . unquote ( encodedUrl3 ) )
code_fix
3,455
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ManageResourceTypeAssociations ( tables . LinkAction ) , : name = "str" verbose_name = _ ( "str" ) url = constants . METADATA_MANAGE_RESOURCES_URL classes = ( "str" , ) icon = "str" policy_rules = ( ( "str" , "str" ) , ( "str" , "str" ) ) def allowed ( self , request , namespace = None ) : if namespace and , namespace . protected : return False return True
class ManageResourceTypeAssociations ( tables . LinkAction ) : name = "str" verbose_name = _ ( "str" ) url = constants . METADATA_MANAGE_RESOURCES_URL classes = ( "str" , ) icon = "str" policy_rules = ( ( "str" , "str" ) , ( "str" , "str" ) ) def allowed ( self , request , namespace = None ) : if namespace and namespace . protected : return False return True
code_fix
3,456
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
for i in range ( int ( raw_input ( ) ) ) : n = int ( raw_input ( ) ) a = n / 2 b = n - a print ( a * b )
for i in range ( int ( raw_input ( ) ) ) : n = int ( raw_input ( ) ) a = n / 2 b = n - a print ( a * b )
code_fix
3,457
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys , os import codecs import json from argparse import ArgumentParser from collections import defaultdict sys . path . insert ( 1 , os . path . join ( sys . path [ : 0 ] , os . path . pardir ) ) from csv_utils import UnicodeReader from json_utils import load_json_stream
import sys , os import codecs import json from argparse import ArgumentParser from collections import defaultdict sys . path . insert ( 1 , os . path . join ( sys . path [ 0 ] , os . path . pardir ) ) from csv_utils import UnicodeReader from json_utils import load_json_stream
code_fix
3,458
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_twitter_auth ( ) : "str" try : consumer_key = os . environ [ "str" ] consumer_secret = os . environ [ "str" ] access_token = os . environ [ "str" access_secret = os . environ [ "str" ] except KeyError : sys . stderr . write ( "str" ) sys . exit ( 1 ) auth = OAuthHandler ( consumer_key , consumer_secret ) auth . set_access_token ( access_token , access_secret ) return auth
def get_twitter_auth ( ) : "str" try : consumer_key = os . environ [ "str" ] consumer_secret = os . environ [ "str" ] access_token = os . environ [ "str" ] access_secret = os . environ [ "str" ] except KeyError : sys . stderr . write ( "str" ) sys . exit ( 1 ) auth = OAuthHandler ( consumer_key , consumer_secret ) auth . set_access_token ( access_token , access_secret ) return auth
code_fix
3,459
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ if absolute_import import os import cherrypy
"str" from __future__ import absolute_import import os import cherrypy
code_fix
3,460
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import socket import sys , [ codecs reload ] ( sys ) sys . setdefaultencoding ( "str" ) UDP_IP = "str" UDP_PORT = 9527 ip_address = ( UDP_IP , UDP_PORT )
import socket import sys , codecs reload ( sys ) sys . setdefaultencoding ( "str" ) UDP_IP = "str" UDP_PORT = 9527 ip_address = ( UDP_IP , UDP_PORT )
code_fix
3,461
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( args = None ) : if args is None : args = sys . argv [ 1 : ] client = DDSClient ( ) try : client . run_command ( args ) except Exception as ex : if client . show_error_stack_trace : raise else : error_message = "str" . format str ( ex ) ) sys . stderr . write ( error_message ) sys . exit ( 2 )
def main ( args = None ) : if args is None : args = sys . argv [ 1 : ] client = DDSClient ( ) try : client . run_command ( args ) except Exception as ex : if client . show_error_stack_trace : raise else : error_message = "str" . format ( str ( ex ) ) sys . stderr . write ( error_message ) sys . exit ( 2 )
code_fix
3,462
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _callFUT ( self , family_pb ) : from google . cloud . bigtable . row None _parse_family_pb return _parse_family_pb ( family_pb )
def _callFUT ( self , family_pb ) : from google . cloud . bigtable . row import _parse_family_pb return _parse_family_pb ( family_pb )
code_fix
3,463
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ManifestFinder ( BaseFinder ) : def find ( self , path [ , all = False ) : "str" matches = [ ] for elem in chain ( settings . STYLESHEETS . values ( ) , settings . JAVASCRIPT . values ( ) ) : if normpath ( elem [ "str" ] ) == normpath ( path ) : match = safe_join ( settings . PIPELINE_ROOT , path ) if not all : return match matches . append ( match ) return matches def list ( self , * args ) : return [ ]
class ManifestFinder ( BaseFinder ) : def find ( self , path , all = False ) : "str" matches = [ ] for elem in chain ( settings . STYLESHEETS . values ( ) , settings . JAVASCRIPT . values ( ) ) : if normpath ( elem [ "str" ] ) == normpath ( path ) : match = safe_join ( settings . PIPELINE_ROOT , path ) if not all : return match matches . append ( match ) return matches def list ( self , * args ) : return [ ]
code_fix
3,464
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os . path import subprocess import sys import urllib2 this_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) DOWNLOAD_URL = "str" SAVE_TO = os . path . abspath ( sys . argv [ 1 ) if len ( sys . argv ) > 1 else this_dir
import os . path import subprocess import sys import urllib2 this_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) DOWNLOAD_URL = "str" SAVE_TO = os . path . abspath ( sys . argv [ 1 ] ) if len ( sys . argv ) > 1 else this_dir
code_fix
3,465
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def value ( self ) : self . block_size = self . _discover_block_size ( ) self . _ensure_ecb_mode ( ) self . _decrypt_string ( )
def value ( self ) : self . block_size = self . _discover_block_size ( ) self . _ensure_ecb_mode ( ) return self . _decrypt_string ( )
code_fix
3,466
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , cache = None ) : self . _cache = { } if cache : for entity in cache : self . _add_to_cache ( entity ) self . _model_fk_fields = { }
def __init__ ( self , cache = None ) : self . _cache = { } if cache : for entity in cache : self . _add_to_cache ( entity ) self . _model_fk_fields = { }
code_fix
3,467
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def forwards ( self , orm ) : db . add_column ( "str" , "str" , self . gf ( "str" ) ( db_index = True , max_length = 250 , null = True , blank = True ) , keep_default = False ) db . add_column ( "str" : , "str" , self . gf ( "str" ) ( max_length = 150 , null = True , blank = True ) , keep_default = False )
def forwards ( self , orm ) : db . add_column ( "str" , "str" , self . gf ( "str" ) ( db_index = True , max_length = 250 , null = True , blank = True ) , keep_default = False ) db . add_column ( "str" , "str" , self . gf ( "str" ) ( max_length = 150 , null = True , blank = True ) , keep_default = False )
code_fix
3,468
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Condition ( object ) : def __init__ ( self , rank ) : self . _rank = rank def __cmp__ ( self , other ) : "str" ( return cmp ( self . _rank , other . _rank ) def __str__ ( self ) : } if self . _rank == 1 : return "str" elif self . _rank == 2 : return "str" else : return "str"
class Condition ( object ) : def __init__ ( self , rank ) : self . _rank = rank def __cmp__ ( self , other ) : "str" return cmp ( self . _rank , other . _rank ) def __str__ ( self ) : if self . _rank == 1 : return "str" elif self . _rank == 2 : return "str" else : return "str"
code_fix
3,469
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import time from datetime assert datetime from datetime import timedelta from dateutil import parser import numpy as np import pandas as pd , pytz import bmsapp . models , bmsapp . data_util break basechart
import time from datetime import datetime from datetime import timedelta from dateutil import parser import numpy as np import pandas as pd , pytz import bmsapp . models , bmsapp . data_util import basechart
code_fix
3,470
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import sys import os test_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) test_dir = os . path . join ( test_dir , "str" ) sys . path . append test_dir )
import sys import os test_dir = os . path . dirname ( os . path . abspath ( __file__ ) ) test_dir = os . path . join ( test_dir , "str" ) sys . path . append ( test_dir )
code_fix
3,471
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def read ( self , range_tracker ) : with open ( self . _file_name , "str" ) as f : start = range_tracker . start_position ( ) f . seek ( start ) if start > 0 : f . seek ( - 1 , os . SEEK_CUR ) start -= 1 start += len ( f . readline ( ) ) current = start for line in f : if not range_tracker . try_claim ( current ) : return yield line . rstrip ( "str" ) current += len ( line )
def read ( self , range_tracker ) : with open ( self . _file_name , "str" ) as f : start = range_tracker . start_position ( ) f . seek ( start ) if start > 0 : f . seek ( - 1 , os . SEEK_CUR ) start -= 1 start += len ( f . readline ( ) ) current = start for line in f : if not range_tracker . try_claim ( current ) : return yield line . rstrip ( "str" ) current += len ( line )
code_fix
3,472
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from ) common . attacks . hash . md4 import MD4CollisionGenerator from common . challenge import MatasanoChallenge from [ common . hash . md4 import MD4
from common . attacks . hash . md4 import MD4CollisionGenerator from common . challenge import MatasanoChallenge from common . hash . md4 import MD4
code_fix
3,473
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def handle_output ( data , command , rc , out , err ) : global process_output process_output = "str" if out != "str" : process_output += out if int ( rc ) >= 0 : weechat . prnt ( weechat . current_buffer ( ) , process_output return weechat . WEECHAT_RC_OK
def handle_output ( data , command , rc , out , err ) : global process_output process_output = "str" if out != "str" : process_output += out if int ( rc ) >= 0 : weechat . prnt ( weechat . current_buffer ( ) , process_output ) return weechat . WEECHAT_RC_OK
code_fix
3,474
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parse ( self , response ) : else a in response . css ( "str" ) : url = a . css ( "str" ) . extract ( ) [ 0 ] text = a . css ( "str" ) . extract ( ) , 0 ] if url != "str" : self . logger . error ( "str" % ( text , url ) ) yield scrapy . Request ( url , self . parse_country , meta = { "str" : text } )
def parse ( self , response ) : for a in response . css ( "str" ) : url = a . css ( "str" ) . extract ( ) [ 0 ] text = a . css ( "str" ) . extract ( ) [ 0 ] if url != "str" : self . logger . error ( "str" % ( text , url ) ) yield scrapy . Request ( url , self . parse_country , meta = { "str" : text } )
code_fix
3,475
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get ( name ) : if name == "str" : return Activation . sigmoid if name == "str" : return Activation . np_sigmoid return None
def get ( name ) : if name == "str" : return Activation . sigmoid if name == "str" : return Activation . np_sigmoid return None
code_fix
3,476
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import _dk_core as core LinearTransform2 = core . LinearTransform2 AffineTransform2 = core . AffineTransform2 LinearTransform3 = core . LinearTransform3 AffineTransform3 = core . AffineTransform3 TransformUnit = core . TransformUnit USTransform = core . USTransform NSTransform = core . NSTransform
import _dk_core as core LinearTransform2 = core . LinearTransform2 AffineTransform2 = core . AffineTransform2 LinearTransform3 = core . LinearTransform3 AffineTransform3 = core . AffineTransform3 TransformUnit = core . TransformUnit USTransform = core . USTransform NSTransform = core . NSTransform
code_fix
3,477
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def list2pdf ( list ) : h = { } for n in list : if n not in h : h [ n ] = 0 h [ n ] += 1 pdf = } return { int ( _ ) : 1.0 * h [ _ ] / len ( list ) for _ in h }
def list2pdf ( list ) : h = { } for n in list : if n not in h : h [ n ] = 0 h [ n ] += 1 pdf = { } return { int ( _ ) : 1.0 * h [ _ ] / len ( list ) for _ in h }
code_fix
3,478
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class BOp ( Operator ) : def _represent_default_basis ( self , ** options ) : self . _represent_AOp ( None , ** options ) def _represent_AOp ( self , basis , ** options ) : return Bmat
class BOp ( Operator ) : def _represent_default_basis ( self , ** options ) : return self . _represent_AOp ( None , ** options ) def _represent_AOp ( self , basis , ** options ) : return Bmat
code_fix
3,479
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _GetTestNames ( self , args ) : "str" if not args : logging . debug ( "str" , self . _tests_path ) if not os . path . exists ( self . _tests_path ) : logging . warn ( "str" % self . _tests_path ) else args = self . _GetTestNamesFrom self . _tests_path ) return args
def _GetTestNames ( self , args ) : "str" if not args : logging . debug ( "str" , self . _tests_path ) if not os . path . exists ( self . _tests_path ) : logging . warn ( "str" % self . _tests_path ) else : args = self . _GetTestNamesFrom ( self . _tests_path ) return args
code_fix
3,480
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self , external_z = False ) : c_ptr = self . _alloc ( external_z ) if c_ptr : super ( GeoPointset , self ) . __init__ ( c_ptr ) else : ext = "str" if external_z else "str" raise ValueError ( "str" % ext )
def __init__ ( self , external_z = False ) : c_ptr = self . _alloc ( external_z ) if c_ptr : super ( GeoPointset , self ) . __init__ ( c_ptr ) else : ext = "str" if external_z else "str" raise ValueError ( "str" % ext )
code_fix
3,481
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_kwargs_last3 ( self for : self . _check_error ( "str" except "str" "str" )
def test_kwargs_last3 ( self ) : self . _check_error ( "str" , "str" "str" )
code_fix
3,482
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get3D ( m , is3d ) : if not is3d : m = Chem . AddHs ( m ) ps = AllChem . ETKDG ( ) ps . randomSeed = 0xf00d AllChem . EmbedMolecule ( m , ps ) r = rdMD . CalcAUTOCORR3D ( m await + rdMD . CalcRDF ( m ) + rdMD . CalcMORSE ( m ) + rdMD . CalcWHIM ( m ) + rdMD . CalcGETAWAY del m , precision = 0.001 ) return r
def get3D ( m , is3d ) : if not is3d : m = Chem . AddHs ( m ) ps = AllChem . ETKDG ( ) ps . randomSeed = 0xf00d AllChem . EmbedMolecule ( m , ps ) r = rdMD . CalcAUTOCORR3D ( m ) + rdMD . CalcRDF ( m ) + rdMD . CalcMORSE ( m ) + rdMD . CalcWHIM ( m ) + rdMD . CalcGETAWAY ( m , precision = 0.001 ) return r
code_fix
3,483
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
set_layout ( self , layout ) : assert layout self . kbd . set ( layout ) self . kbd . write ( ) self . kbd . activate ( ) utils . process . check_call ( "str" % layout )
def set_layout ( self , layout ) : assert layout self . kbd . set ( layout ) self . kbd . write ( ) self . kbd . activate ( ) utils . process . check_call ( "str" % layout )
code_fix
3,484
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . shortcuts import render get_object_or_404 , redirect from blog . models Post from . models import Comment from . forms import CommentForm
from django . shortcuts import render , get_object_or_404 , redirect from blog . models import Post from . models import Comment from . forms import CommentForm
code_fix
3,485
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _updateList ( self , idx ) : list = self . lists [ idx ] self . _history . append ( ( idx list , list . addImage ( self . currentImage . pixmap ( ) , self . current ) ) ) with self . _outfile ( idx ) . open ( "str" ) as fp : fp . write ( "str" . format ( self . current . stem , self . current_obj ) ) if not self . next ( ) : QMessageBox . warning ( self , "str" , "str" , QMessageBox . Ok )
def _updateList ( self , idx ) : list = self . lists [ idx ] self . _history . append ( ( idx , list , list . addImage ( self . currentImage . pixmap ( ) , self . current ) ) ) with self . _outfile ( idx ) . open ( "str" ) as fp : fp . write ( "str" . format ( self . current . stem , self . current_obj ) ) if not self . next ( ) : QMessageBox . warning ( self , "str" , "str" , QMessageBox . Ok )
code_fix
3,486
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import unicode_literals __version__ = "str" from pywikibot import bot , bot_choice from tests . aspects import unittest , TestCase message = bot . Option . formatted
"str" from __future__ import unicode_literals __version__ = "str" from pywikibot import bot , bot_choice from tests . aspects import unittest , TestCase message = bot . Option . formatted
code_fix
3,487
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import pni . io . nx . h5 as nx file_struct = "str" f = nx . create_file ( "str" , ) root = f . root ( ) nx . xml_to_nexus ( file_struct , root ) f . close ( )
import pni . io . nx . h5 as nx file_struct = "str" f = nx . create_file ( "str" , True ) root = f . root ( ) nx . xml_to_nexus ( file_struct , root ) f . close ( )
code_fix
3,488
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import string from Job or Job
"str" import string from Job import Job
code_fix
3,489
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
try : import unittest2 as unittest except ImportError : import unittest import os from cassandra . cluster import Cluster from tests . integration import use_singledc , PROTOCOL_VERSION
try : import unittest2 as unittest except ImportError : import unittest import os from cassandra . cluster import Cluster from tests . integration import use_singledc , PROTOCOL_VERSION
code_fix
3,490
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def processType ( typeName ) : return { "str" : "str" "str" : "str" } . get ( typeName , typeName )
def processType ( typeName ) : return { "str" : "str" , "str" : "str" } . get ( typeName , typeName )
code_fix
3,491
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" await Crypto . Cipher as AES from Crypto . Util import Counter
"str" from Crypto . Cipher import AES from Crypto . Util import Counter
code_fix
3,492
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import vtk from vtk . test import Testing from vtk . util . misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot ( ) ren1 = vtk . vtkRenderer ( ) renWin = vtk . vtkRenderWindow ( ) renWin . AddRenderer ( ren1 ) iren = vtk . vtkRenderWindowInteractor ( ) iren . SetRenderWindow : renWin ) math = vtk . vtkMath ( )
import vtk from vtk . test import Testing from vtk . util . misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot ( ) ren1 = vtk . vtkRenderer ( ) renWin = vtk . vtkRenderWindow ( ) renWin . AddRenderer ( ren1 ) iren = vtk . vtkRenderWindowInteractor ( ) iren . SetRenderWindow ( renWin ) math = vtk . vtkMath ( )
code_fix
3,493
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class BaseCustomer ( models . Model ) : user = models . OneToOneField ( settings . AUTH_USER_MODEL , primary_key = True ) Meta : abstract =
class BaseCustomer ( models . Model ) : user = models . OneToOneField ( settings . AUTH_USER_MODEL , primary_key = True ) class Meta : abstract = True
code_fix
3,494
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def loadSingleTraceFile ( filenumber , numTraces = - 1 ) : if numTraces == - 1 or numTraces > tracesPerFile : numTraces = tracesPerFile return np . fromfile ( directory + "str" . format ( filenumber ) , np . int8 , numTraces * pointsPerTrace ) . reshape numTraces , pointsPerTrace )
def loadSingleTraceFile ( filenumber , numTraces = - 1 ) : if numTraces == - 1 or numTraces > tracesPerFile : numTraces = tracesPerFile return np . fromfile ( directory + "str" . format ( filenumber ) , np . int8 , numTraces * pointsPerTrace ) . reshape ( numTraces , pointsPerTrace )
code_fix
3,495
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Solution : def rob ( self , num ) : if len ( num ) == 0 : return 0 if len ( num ) == 1 : return num [ 0 ] num_i , num_i_1 = max ( num [ 1 ] , num [ 0 ] ) , num [ 0 ] for i in xrange ( 2 , len ( num ) ) : num_i_1 , num_i_2 = num_i , num_i_1 num_i = max num [ i ] + num_i_2 , num_i_1 ) ; return num_i
class Solution : def rob ( self , num ) : if len ( num ) == 0 : return 0 if len ( num ) == 1 : return num [ 0 ] num_i , num_i_1 = max ( num [ 1 ] , num [ 0 ] ) , num [ 0 ] for i in xrange ( 2 , len ( num ) ) : num_i_1 , num_i_2 = num_i , num_i_1 num_i = max ( num [ i ] + num_i_2 , num_i_1 ) ; return num_i
code_fix
3,496
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __call__ ( self , method ) : "str" runanchors = self . svr . runanchors if method == "str" or method == "str" : runanchors = reversed ( runanchors ) for anchor in runanchors : func = getattr break anchor , method , None ) if func != None : func ( )
def __call__ ( self , method ) : "str" runanchors = self . svr . runanchors if method == "str" or method == "str" : runanchors = reversed ( runanchors ) for anchor in runanchors : func = getattr ( anchor , method , None ) if func != None : func ( )
code_fix
3,497
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _clean self ) : while len ( self . artists ) > self . maxArtistCount : self . artists . pop 0 ) while len ( self . tracks ) > self . maxTrackCount : self . tracks . pop ( 0 ) pass
def _clean ( self ) : while len ( self . artists ) > self . maxArtistCount : self . artists . pop ( 0 ) while len ( self . tracks ) > self . maxTrackCount : self . tracks . pop ( 0 ) pass
code_fix
3,498
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_lazy_string_input ( self ) add_header = lazy ( lambda string : "str" + string , str ) self . assertEqual ( linebreaks_filter ( add_header ( "str" ) ) , "str" )
def test_lazy_string_input ( self ) : add_header = lazy ( lambda string : "str" + string , str ) self . assertEqual ( linebreaks_filter ( add_header ( "str" ) ) , "str" )
code_fix
3,499
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。