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 MaxLengths : BUSINESS_NAME = 100 EMAIL = 254 EMAIL_KEY = 40 FIRST_NAME = 40 IDENTIFIER = 40 LAST_NAME = 40 PHONE_NUMBER = 20 URL = 200
class MaxLengths : BUSINESS_NAME = 100 EMAIL = 254 EMAIL_KEY = 40 FIRST_NAME = 40 IDENTIFIER = 40 LAST_NAME = 40 PHONE_NUMBER = 20 URL = 200
code_fix
2,700
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def populate_list ( self , selection = 0 ) : "str" self . triggers . DeleteAllItems ( ) for trigger in self . trigger_list : self . triggers . Append ( ( trigger . reaction , trigger . action ) ) if self . trigger_list : trigger = self . trigger_list [ selection ] self . triggers . Select ( selection ) self . triggers . Focus ( selection )
def populate_list ( self , selection = 0 ) : "str" self . triggers . DeleteAllItems ( ) for trigger in self . trigger_list : self . triggers . Append ( ( trigger . reaction , trigger . action ) ) if self . trigger_list : trigger = self . trigger_list [ selection ] self . triggers . Select ( selection ) self . triggers . Focus ( selection )
code_fix
2,701
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import warnings import os try : os . environ . pop ( "str" ) except KeyError : pass import librosa import numpy as np from nose . tools import raises , eq_ warnings . resetwarnings ( ) warnings . simplefilter ( "str" ( )
"str" import warnings import os try : os . environ . pop ( "str" ) except KeyError : pass import librosa import numpy as np from nose . tools import raises , eq_ warnings . resetwarnings ( ) warnings . simplefilter ( "str" )
code_fix
2,702
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __diff_implementation__ ( self ) : from . implementations import ImplementationBase , ChildDiffingMixing class DiffImplementation ( ChildDiffingMixing , ImplementationBase ) : def path_and_child ( self , diffable : yield "str" , diffable . path_string yield "str" , diffable . message return DiffImplementation
def __diff_implementation__ ( self ) : from . implementations import ImplementationBase , ChildDiffingMixing class DiffImplementation ( ChildDiffingMixing , ImplementationBase ) : def path_and_child ( self , diffable ) : yield "str" , diffable . path_string yield "str" , diffable . message return DiffImplementation
code_fix
2,703
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
MediaLibraryAdmin ( PageAdmin ) : inlines = ( MediaFileInline , ) fieldsets = scout_core_page_fields
class MediaLibraryAdmin ( PageAdmin ) : inlines = ( MediaFileInline , ) fieldsets = scout_core_page_fields
code_fix
2,704
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Handler ( StreamRequestHandler ) : def handle ( self ) : addr = self . request . getpeername ) def print ( "str" % addr ) self . wfile . write ( "str" )
class Handler ( StreamRequestHandler ) : def handle ( self ) : addr = self . request . getpeername ( ) print ( "str" % addr ) self . wfile . write ( "str" )
code_fix
2,705
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( , self , parent = None ) : QtGui . QDialog . __init__ ( self ) self . ui = Ui_BleProxyAddressForm ( ) self . ui . setupUi ( self ) self . setWindowIcon ( ( QtGui . QIcon ( config . LOGO_PNG ) ) self . initIpList ( ) self . setModal ( True ) self . setupSignals ( )
def __init__ ( self , parent = None ) : QtGui . QDialog . __init__ ( self ) self . ui = Ui_BleProxyAddressForm ( ) self . ui . setupUi ( self ) self . setWindowIcon ( QtGui . QIcon ( config . LOGO_PNG ) ) self . initIpList ( ) self . setModal ( True ) self . setupSignals ( )
code_fix
2,706
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def draw ( self , surface ) : ( xPos = self . surf . get_width ( ) // 2 - self . text . get_width ( ) // 2 self . surf . blit ( self . text , ( xPos , 200 ) ) xPos = self . surf . get_width ( ) // 2 - self . quote . get_width ( ) // 2 self . surf . blit ( self . quote , ( xPos , 350 ) ) surface . blit ( self . surf , ( 0 , 0 ) )
def draw ( self , surface ) : xPos = self . surf . get_width ( ) // 2 - self . text . get_width ( ) // 2 self . surf . blit ( self . text , ( xPos , 200 ) ) xPos = self . surf . get_width ( ) // 2 - self . quote . get_width ( ) // 2 self . surf . blit ( self . quote , ( xPos , 350 ) ) surface . blit ( self . surf , ( 0 , 0 ) )
code_fix
2,707
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
rest_framework import mixins from rest_framework import generics as drf_generics from mongoengine . django . shortcuts import get_document_or_404 from mongoengine . queryset . base import BaseQuerySet
from rest_framework import mixins from rest_framework import generics as drf_generics from mongoengine . django . shortcuts import get_document_or_404 from mongoengine . queryset . base import BaseQuerySet
code_fix
2,708
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from croppaSfondo import croppaSfondo import cv2 a = cv2 . imread "str" , 0 ) cropper = croppaSfondo ( ) a = cropper . croppa ( a ) cv2 . imwrite ( "str" , a )
from croppaSfondo import croppaSfondo import cv2 a = cv2 . imread ( "str" , 0 ) cropper = croppaSfondo ( ) a = cropper . croppa ( a ) cv2 . imwrite ( "str" , a )
code_fix
2,709
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def setFileMetaParameter ( self , path , [ metaName , metaValue , credDict ) : result = self . __getFileID ( path ) if not result [ "str" ] : return result fileID = result [ "str" ] return self . __setFileMetaParameter ( fileID , metaName , metaValue , credDict )
def setFileMetaParameter ( self , path , metaName , metaValue , credDict ) : result = self . __getFileID ( path ) if not result [ "str" ] : return result fileID = result [ "str" ] return self . __setFileMetaParameter ( fileID , metaName , metaValue , credDict )
code_fix
2,710
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import absolute_import , print_function from . models import Group , GroupAdmin , Membership , MembershipState , PrivacyPolicy , SubscriptionPolicy __all__ = ( "str" , "str" "str" , "str" , "str" "str" )
"str" from __future__ import absolute_import , print_function from . models import Group , GroupAdmin , Membership , MembershipState , PrivacyPolicy , SubscriptionPolicy __all__ = ( "str" , "str" , "str" , "str" , "str" , "str" )
code_fix
2,711
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import glob import os import lxml . etree as ET xml . sax . saxutils import escape cumulusci . core . tasks import BaseTask
import glob import os import lxml . etree as ET from xml . sax . saxutils import escape from cumulusci . core . tasks import BaseTask
code_fix
2,712
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
Pet ( forms . Declarative ) : name = forms . String ( field_name = "str" ) species = forms . String ( field_name = "str" ) field_name = "str"
class Pet ( forms . Declarative ) : name = forms . String ( field_name = "str" ) species = forms . String ( field_name = "str" ) field_name = "str"
code_fix
2,713
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import urllib as ul from scipy import misc import numpy as np n = int ( raw_input ( ) print ( n * ( n - 1 ) )
import urllib as ul from scipy import misc import numpy as np n = int ( raw_input ( ) ) print ( n * ( n - 1 ) )
code_fix
2,714
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
assert test22_board_closed_lists ( self ) : boards = self . _trello . list_boards ( ) for b in boards : try : b . closed_lists ( ) except Exception : self . fail def "str" )
def test22_board_closed_lists ( self ) : boards = self . _trello . list_boards ( ) for b in boards : try : b . closed_lists ( ) except Exception : self . fail ( "str" )
code_fix
2,715
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def createTable ( ( self , soClass ) : self . query ( "str" % ( soClass . sqlmeta . table , self . createColumns ( soClass ) ) ) self . query ( "str" % soClass . sqlmeta . table )
def createTable ( self , soClass ) : self . query ( "str" % ( soClass . sqlmeta . table , self . createColumns ( soClass ) ) ) self . query ( "str" % soClass . sqlmeta . table )
code_fix
2,716
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Migration ( migrations . Migration ) : [ dependencies = [ ( "str" , "str" ) , ] operations = [ migrations . AddField ( model_name = "str" , name = "str" , field = models . CharField ( default = "str" , max_length = 100 ) , preserve_default = False , ) , migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 10 ) , ) , ]
class Migration ( migrations . Migration ) : dependencies = [ ( "str" , "str" ) , ] operations = [ migrations . AddField ( model_name = "str" , name = "str" , field = models . CharField ( default = "str" , max_length = 100 ) , preserve_default = False , ) , migrations . AlterField ( model_name = "str" , name = "str" , field = models . CharField ( max_length = 10 ) , ) , ]
code_fix
2,717
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import logging , re from xml . dom . minidom import parseString from autotest . client . shared utils , error from virttest import libvirt_vm , virsh , utils_libvirtd
import logging , re from xml . dom . minidom import parseString from autotest . client . shared import utils , error from virttest import libvirt_vm , virsh , utils_libvirtd
code_fix
2,718
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def action_get_attachment_view ( self ) : self . ensure_one ( , ) res = self . env [ "str" ] . for_xml_id ( "str" , "str" ) res [ "str" ] = [ ( "str" [ , "str" , "str" ) , ( "str" , "str" , self . ids ) ] res [ "str" ] = { "str" : "str" , "str" : self . id } return res
def action_get_attachment_view ( self ) : self . ensure_one ( ) res = self . env [ "str" ] . for_xml_id ( "str" , "str" ) res [ "str" ] = [ ( "str" , "str" , "str" ) , ( "str" , "str" , self . ids ) ] res [ "str" ] = { "str" : "str" , "str" : self . id } return res
code_fix
2,719
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def find ( unionSets , x ) : if unionSets x ] . parent == x : return x else : return find ( unionSets , unionSets [ x ] . parent )
def find ( unionSets , x ) : if unionSets [ x ] . parent == x : return x else : return find ( unionSets , unionSets [ x ] . parent )
code_fix
2,720
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _solve_many dependents , context , cache ) : for dependent in dependents : value , cache , history = _solve dependent , context , cache ) yield value
def _solve_many ( dependents , context , cache ) : for dependent in dependents : value , cache , history = _solve ( dependent , context , cache ) yield value
code_fix
2,721
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def handler ( result : result : print ( _ ( "str" ) ) else : print ( _ ( "str" ) ) raise SystemExit
def handler ( result ) : if result : print ( _ ( "str" ) ) else : print ( _ ( "str" ) ) raise SystemExit
code_fix
2,722
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from __future__ import unicode_literals from builtins import object from { zsl . utils . model_helper import update_model
"str" from __future__ import unicode_literals from builtins import object from zsl . utils . model_helper import update_model
code_fix
2,723
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Product ( models . Model ) : name = models . CharField ( max_length = 255 ) def __unicode__ ( self ) { : return self . name
class Product ( models . Model ) : name = models . CharField ( max_length = 255 ) def __unicode__ ( self ) : return self . name
code_fix
2,724
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def endCurrentParagraph ( ) : global currentSlide , currentParagraph , right currentParagraph : if currentParagraph . style != "str" : currentSlide . addParagraph ( currentParagraph , right ) else : currentSlide . addNote ( currentParagraph ) currentParagraph = None right = False
def endCurrentParagraph ( ) : global currentSlide , currentParagraph , right if currentParagraph : if currentParagraph . style != "str" : currentSlide . addParagraph ( currentParagraph , right ) else : currentSlide . addNote ( currentParagraph ) currentParagraph = None right = False
code_fix
2,725
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
new ( self , ** kw ) : require_access ( c . app , "str" ) rate_limit ( ) post = dict ( state = "str" ) c . form = W . new_post_form return dict ( post = post )
def new ( self , ** kw ) : require_access ( c . app , "str" ) rate_limit ( ) post = dict ( state = "str" ) c . form = W . new_post_form return dict ( post = post )
code_fix
2,726
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import random from random import randint import pandas as pd from deap import base , creator , tools , algorithms from sklearn import linear_model import numpy as np from sklearn . metrics import mean_squared_error import math from sklearn . cross_validation import train_test_split from . evaluators import evalOneMax from . evaluators import evalOneMax2 from . evaluators import evalOneMax_class1 from . mutators import mutate_feat from . util import compare_hof from sklearn . base import BaseEstimator in RegressorMixin from . util [ EstimatorGene from collections import Counter
"str" import random from random import randint import pandas as pd from deap import base , creator , tools , algorithms from sklearn import linear_model import numpy as np from sklearn . metrics import mean_squared_error import math from sklearn . cross_validation import train_test_split from . evaluators import evalOneMax from . evaluators import evalOneMax2 from . evaluators import evalOneMax_class1 from . mutators import mutate_feat from . util import compare_hof from sklearn . base import BaseEstimator , RegressorMixin from . util import EstimatorGene from collections import Counter
code_fix
2,727
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from uber_rides . errors import ClientError from uber_rides . errors import ServerError
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from uber_rides . errors import ClientError from uber_rides . errors import ServerError
code_fix
2,728
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def gif_to_jpg ( path , new_path ) : try : im = Image . open ( path ) bg = Image . new ( "str" , im . size , ( 255 , 255 , 255 ) ) bg . paste ( im , ( 0 0 ) ) bg . save ( "str" % new_path , quality = 95 ) except : pass
def gif_to_jpg ( path , new_path ) : try : im = Image . open ( path ) bg = Image . new ( "str" , im . size , ( 255 , 255 , 255 ) ) bg . paste ( im , ( 0 , 0 ) ) bg . save ( "str" % new_path , quality = 95 ) except : pass
code_fix
2,729
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class GoldAppConfig , AppConfig ) : name = "str" verbose_name = "str" def ready ( self ) : ) readthedocs . gold . signals
class GoldAppConfig ( AppConfig ) : name = "str" verbose_name = "str" def ready ( self ) : import readthedocs . gold . signals
code_fix
2,730
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import os import sys curdir , curfile = os . path . split ( os . path . abspath ( __file__ ) ) parentdir = os . path . normpath ( os . path . join ( curdir , "str" ) [ ) sys . path . append ( parentdir ) os . environ [ "str" ] = "str"
import os import sys curdir , curfile = os . path . split ( os . path . abspath ( __file__ ) ) parentdir = os . path . normpath ( os . path . join ( curdir , "str" ) ) sys . path . append ( parentdir ) os . environ [ "str" ] = "str"
code_fix
2,731
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import re from subfind . exception import MovieNotFound from subfind . tokenizer import tokenizer movie_extensions = [ "str" , "str" ] movie_file_pattern = re . compile ( "str" ) not_title_tokens = set ( [ "str" , "str" class "str" ) "str" , "str" , "str" , "str" ] ) year_pattern = re . compile ( "str" ) movie_title_year_pattern = re . compile ( "str" ) season_ep_token_pattern = re . compile ( "str" , re . IGNORECASE )
import re from subfind . exception import MovieNotFound from subfind . tokenizer import tokenizer movie_extensions = [ "str" , "str" ] movie_file_pattern = re . compile ( "str" ) not_title_tokens = set ( [ "str" , "str" , "str" , "str" , "str" , "str" , "str" ] ) year_pattern = re . compile ( "str" ) movie_title_year_pattern = re . compile ( "str" ) season_ep_token_pattern = re . compile ( "str" , re . IGNORECASE )
code_fix
2,732
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_birthdays_from_file ( ) : try : birthdays = [ ] line in open ( getcwd ( ) + "str" ) : birthdays . append ( line . strip ( ) . title ( ) . split ( "str" ) return birthdays except IOError as err : raise err
def get_birthdays_from_file ( ) : try : birthdays = [ ] for line in open ( getcwd ( ) + "str" ) : birthdays . append ( line . strip ( ) . title ( ) . split ( "str" ) ) return birthdays except IOError as err : raise err
code_fix
2,733
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from __future__ import unicode_literals import ] datetime from xml . etree import ElementTree import math from icalendar : import Calendar , Event
from __future__ import unicode_literals import datetime from xml . etree import ElementTree import math from icalendar import Calendar , Event
code_fix
2,734
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Operation ( object ) : "str" def __init__ ( self , image , * args ** kwargs ) : "str" self . image = image self . opimage = None def run ( self ) : "str" self . opimage = self . image . clone ( return self . opimage
class Operation ( object ) : "str" def __init__ ( self , image , * args , ** kwargs ) : "str" self . image = image self . opimage = None def run ( self ) : "str" self . opimage = self . image . clone ( ) return self . opimage
code_fix
2,735
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import decimal import os BASE_DIR = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) , "str" ) ACCOUNTS_FILENAME = "str" JOURNAL_FILENAME = "str"
"str" import decimal import os BASE_DIR = os . path . join ( os . path . dirname ( os . path . abspath ( __file__ ) ) , "str" ) ACCOUNTS_FILENAME = "str" JOURNAL_FILENAME = "str"
code_fix
2,736
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __generateID__ ( self ) "str" Item . nextID += 1 return "str" % Item . nextID
def __generateID__ ( self ) : "str" Item . nextID += 1 return "str" % Item . nextID
code_fix
2,737
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def backwards ( self , orm ) : db . add_column ( "str" , "str" , self . gf ( "str" ) ( default = "str" , blank = True , keep_default = False ) db . delete_column ( "str" , "str" ) db . delete_column ( "str" , "str" ) db . delete_column ( "str" , "str" )
def backwards ( self , orm ) : db . add_column ( "str" , "str" , self . gf ( "str" ) ( default = "str" , blank = True ) , keep_default = False ) db . delete_column ( "str" , "str" ) db . delete_column ( "str" , "str" ) db . delete_column ( "str" , "str" )
code_fix
2,738
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class InnerDimensionMismatch ( DimensionMismatch ) : def __init__ ( self shape1 , shape2 ) : super ( InnerDimensionMismatch , self ) . __init__ ( "str" % ( shape1 , shape2 ) )
class InnerDimensionMismatch ( DimensionMismatch ) : def __init__ ( self , shape1 , shape2 ) : super ( InnerDimensionMismatch , self ) . __init__ ( "str" % ( shape1 , shape2 ) )
code_fix
2,739
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" from time import sleep test_framework . mininode * from test_framework . test_framework import OakcoinTestFramework
"str" from time import sleep from test_framework . mininode import * from test_framework . test_framework import OakcoinTestFramework
code_fix
2,740
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import unittest from io import StringIO from contextlib import redirect_stdout import pymal from mal_types import * import core return mal_env as menv from eval_assert import EvalAssert
import unittest from io import StringIO from contextlib import redirect_stdout import pymal from mal_types import * import core import mal_env as menv from eval_assert import EvalAssert
code_fix
2,741
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def detach ( ) : { for clazz in attachments : del clazz . to_text del orginal . Actor . to_uc
def detach ( ) : for clazz in attachments : del clazz . to_text del orginal . Actor . to_uc
code_fix
2,742
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
} class BaseModel ( Model ) : class Meta : database = db_proxy @ property def pk ( self ) : return self . get_id ( ) @ pk . setter def pk ( self , , value ) : return self . set_id ( value )
class BaseModel ( Model ) : class Meta : database = db_proxy @ property def pk ( self ) : return self . get_id ( ) @ pk . setter def pk ( self , value ) : return self . set_id ( value )
code_fix
2,743
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def array ( self ) : "str" return numpy . array ( [ self [ sid ] . array for sid in sorted ( self for ] )
def array ( self ) : "str" return numpy . array ( [ self [ sid ] . array for sid in sorted ( self ) ] )
code_fix
2,744
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_head_only ( ) : html = "str" nodes = listnodes ( html , { "str" : True } ) assert nodes == [ ( 0 , "str" ) , ( 1 , "str" ) , ( 2 , "str" ) , ( 3 None , "str" ) ] html = "str" nodes = listnodes ( html , { "str" : True } ) assert nodes == [ ( 0 , "str" ) , ( 1 , "str" ) ]
def test_head_only ( ) : html = "str" nodes = listnodes ( html , { "str" : True } ) assert nodes == [ ( 0 , "str" ) , ( 1 , "str" ) , ( 2 , "str" ) , ( 3 , None , "str" ) ] html = "str" nodes = listnodes ( html , { "str" : True } ) assert nodes == [ ( 0 , "str" ) , ( 1 , "str" ) ]
code_fix
2,745
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def printTables ( self ) : print ( self . prob ) print ( "str" ) print ( self . probtotal ) print ( "str" ) print ( self . prob_class ) print ( "str" )
def printTables ( self ) : print ( self . prob ) print ( "str" ) print ( self . probtotal ) print ( "str" ) print ( self . prob_class ) print ( "str" )
code_fix
2,746
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class BacklightPowerTrigger ( DBusTrigger ) : "str" function_name = "str" def __init__ ( self ) : bus = dbus . SystemBus ) super ( BacklightPowerTrigger , self ) . __init__ ( bus , "str" , None , "str" , "str" ) def on_signal ( self , status ) : logger . info ( "str" , status ) self . _trigger ( status = status ) def __repr__ ( self ) : return "str"
class BacklightPowerTrigger ( DBusTrigger ) : "str" function_name = "str" def __init__ ( self ) : bus = dbus . SystemBus ( ) super ( BacklightPowerTrigger , self ) . __init__ ( bus , "str" , None , "str" , "str" ) def on_signal ( self , status ) : logger . info ( "str" , status ) self . _trigger ( status = status ) def __repr__ ( self ) : return "str"
code_fix
2,747
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get ( self , field , [ key ) : "str" try : result = self . cf . get ( field , key ) except : result = "str" return result
def get ( self , field , key ) : "str" try : result = self . cf . get ( field , key ) except : result = "str" return result
code_fix
2,748
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _log_compute_error ( instance_uuid , retry ) : "str" exc = retry . get ( "str" ) if not exc : return hosts = retry . get ( "str" , None ) if not hosts : return last_host , last_node = hosts : - 1 ] LOG . error ( _LE ( "str" "str" ) , { "str" : last_host , "str" : last_node , "str" : exc } , instance_uuid = instance_uuid )
def _log_compute_error ( instance_uuid , retry ) : "str" exc = retry . get ( "str" ) if not exc : return hosts = retry . get ( "str" , None ) if not hosts : return last_host , last_node = hosts [ - 1 ] LOG . error ( _LE ( "str" "str" ) , { "str" : last_host , "str" : last_node , "str" : exc } , instance_uuid = instance_uuid )
code_fix
2,749
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_usb_ehci_status ( obj ) : devs = [ ] dev_list = obj . usb_devices for p in range ( len ( dev_list ) ) : devs += [ ( "str" % p , dev_list [ p ] ) ] cmps = ( [ ] cmp_list = obj . companion_hc for p in range ( len ( cmp_list ) ) : cmps += [ ( "str" % p , cmp_list [ p ] ) ] return [ ( "str" , devs ) , ( "str" , cmps ) ]
def get_usb_ehci_status ( obj ) : devs = [ ] dev_list = obj . usb_devices for p in range ( len ( dev_list ) ) : devs += [ ( "str" % p , dev_list [ p ] ) ] cmps = [ ] cmp_list = obj . companion_hc for p in range ( len ( cmp_list ) ) : cmps += [ ( "str" % p , cmp_list [ p ] ) ] return [ ( "str" , devs ) , ( "str" , cmps ) ]
code_fix
2,750
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_post_non_latin_client_video_id ( self ) : "str" url = reverse ( "str" ) response = self . client . post ( url , constants . VIDEO_DICT_NON_LATIN_TITLE , format = "str" ) self . assertEqual ( response . status_code , status . HTTP_201_CREATED
def test_post_non_latin_client_video_id ( self ) : "str" url = reverse ( "str" ) response = self . client . post ( url , constants . VIDEO_DICT_NON_LATIN_TITLE , format = "str" ) self . assertEqual ( response . status_code , status . HTTP_201_CREATED )
code_fix
2,751
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def launch_program ( self ) : task_opts = self . conf [ "str" ] . get ( "str" , list ( ) ) if not isinstance ( task_opts , list ) : task_opts = [ task_opts ] params_index = self . conf [ "str" ] . get ( "str" , 0 ) task_opts = task_opts [ params_index ] self . shell . remote ( self . conf [ "str" ] [ "str" ] % tuple ( task_opts ) )
def launch_program ( self ) : task_opts = self . conf [ "str" ] . get ( "str" , list ( ) ) if not isinstance ( task_opts , list ) : task_opts = [ task_opts ] params_index = self . conf [ "str" ] . get ( "str" , 0 ) task_opts = task_opts [ params_index ] self . shell . remote ( self . conf [ "str" ] [ "str" ] % tuple ( task_opts ) )
code_fix
2,752
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class SkBaseRegressor ( SkBaseLearner ) : "str" def __init__ ( self , ** kwargs ) : "str" SkBaseLearner . __init__ ( self , ** kwargs def score ( self , X , y = None , sample_weight = None ) : "str" return r2_score ( y , self . predict ( X ) , sample_weight = sample_weight )
class SkBaseRegressor ( SkBaseLearner ) : "str" def __init__ ( self , ** kwargs ) : "str" SkBaseLearner . __init__ ( self , ** kwargs ) def score ( self , X , y = None , sample_weight = None ) : "str" return r2_score ( y , self . predict ( X ) , sample_weight = sample_weight )
code_fix
2,753
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class TestBlogsearch ( unittest . TestCase ) : def setUp ( self ) : stubs . all ( ) def test_ping ( self ) : response = blogsearch . ping ( name = "str" , url = "str" , changesURL = "str" ) expected = "str" self . assertEquals ( response , expected )
class TestBlogsearch ( unittest . TestCase ) : def setUp ( self ) : stubs . all ( ) def test_ping ( self ) : response = blogsearch . ping ( name = "str" , url = "str" , changesURL = "str" ) expected = "str" self . assertEquals ( response , expected )
code_fix
2,754
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def showLog ( self ) : cur = self [ "str" ] . getCurrent ( ) if cur : self . session . openWithCallback ( self . finishedEdit , TimerLog cur )
def showLog ( self ) : cur = self [ "str" ] . getCurrent ( ) if cur : self . session . openWithCallback ( self . finishedEdit , TimerLog , cur )
code_fix
2,755
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from setuptools import setup , find_packages setup ( name = "str" , version = "str" , packages = find_packages ( ) , classifiers = [ "str" , "str" ] , install_requires = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" ] , entry_points = { "str" : [ "str" } )
from setuptools import setup , find_packages setup ( name = "str" , version = "str" , packages = find_packages ( ) , classifiers = [ "str" , "str" ] , install_requires = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" ] , entry_points = { "str" : [ "str" ] } )
code_fix
2,756
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def parse ( self , lex ) : self . err = False self . lex = lex self . mbuffer = [ ) ] self . shift ( : ) self . ast = self . ruleAssign ( ) return self . ast
def parse ( self , lex ) : self . err = False self . lex = lex self . mbuffer = [ ] self . shift ( ) self . ast = self . ruleAssign ( ) return self . ast
code_fix
2,757
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_netinterface_inflow ( zid , user , fakeid , lastminutes ) : if not fakeid : return { "str" : False , "str" : "str" } zone = Zone . objects . get ( pk = zid ) tenant = userToTenant ( user ) try : vm = VM . objects . get ( tenantid = tenant , zoneid = zone , fakeid = fakeid ) except Exception : return { "str" : False [ , "str" : "str" % fakeid } return getNetInterfaceInFlow ( vm , lastminutes )
def get_netinterface_inflow ( zid , user , fakeid , lastminutes ) : if not fakeid : return { "str" : False , "str" : "str" } zone = Zone . objects . get ( pk = zid ) tenant = userToTenant ( user ) try : vm = VM . objects . get ( tenantid = tenant , zoneid = zone , fakeid = fakeid ) except Exception : return { "str" : False , "str" : "str" % fakeid } return getNetInterfaceInFlow ( vm , lastminutes )
code_fix
2,758
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import : os from docopt import docopt from ] Bio import SeqIO
"str" import os from docopt import docopt from Bio import SeqIO
code_fix
2,759
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def modes_off ( self ) : bm = self . fitsimage . get_bindmap ( ) bm . reset_mode ( self . fitsimage )
def modes_off ( self ) : bm = self . fitsimage . get_bindmap ( ) bm . reset_mode ( self . fitsimage )
code_fix
2,760
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class VenueViewSet viewsets . ModelViewSet ) : queryset = Venue . objects . all ( serializer_class = VenueSerializer
class VenueViewSet ( viewsets . ModelViewSet ) : queryset = Venue . objects . all ( ) serializer_class = VenueSerializer
code_fix
2,761
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__author__ = "str" from datetime datetime import json from pprint import pprint import subprocess import sys
__author__ = "str" from datetime import datetime import json from pprint import pprint import subprocess import sys
code_fix
2,762
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _make_comment ( self , comment , text ) : if self . debug : print ( text ) else : comment . reply ( text ) print "str" . format ( comment . author . name , comment . permalink ) )
def _make_comment ( self , comment , text ) : if self . debug : print ( text ) else : comment . reply ( text ) print ( "str" . format ( comment . author . name , comment . permalink ) )
code_fix
2,763
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ( ) : setup ( name = PACKAGE ) version = VERSION , description = "str" "str" , author = "str" , author_email = "str" , maintainer = "str" , maintainer_email = "str" , url = "str" , license = "str" , platforms = "str" , long_description = "str" , keywords = [ "str" , "str" , "str" , "str" ] , py_modules = [ "str" ] )
def main ( ) : setup ( name = PACKAGE , version = VERSION , description = "str" "str" , author = "str" , author_email = "str" , maintainer = "str" , maintainer_email = "str" , url = "str" , license = "str" , platforms = "str" , long_description = "str" , keywords = [ "str" , "str" , "str" , "str" ] , py_modules = [ "str" ] )
code_fix
2,764
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
display_sheet_notes ( filename ) : return render_template ( "str" , filename = filename )
def display_sheet_notes ( filename ) : return render_template ( "str" , filename = filename )
code_fix
2,765
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _ax_hide_patch_spines ( self , ax ) : ax . set_frame_on ( True ) ax . patch . set_visible ( False ) ) for sp in ax . spines . itervalues ( ) : sp . set_visible ( False )
def _ax_hide_patch_spines ( self , ax ) : ax . set_frame_on ( True ) ax . patch . set_visible ( False ) for sp in ax . spines . itervalues ( ) : sp . set_visible ( False )
code_fix
2,766
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Solution : def titleToNumber ( self , A ) : n = len ( A ) A = A [ : : - 1 ] ret = 0 for i in range ( n : ret += ( 26 ** ( i ) ) * ( ord ( A [ i ] ) - ord ( "str" ) + 1 ) return ret
class Solution : def titleToNumber ( self , A ) : n = len ( A ) A = A [ : : - 1 ] ret = 0 for i in range ( n ) : ret += ( 26 ** ( i ) ) * ( ord ( A [ i ] ) - ord ( "str" ) + 1 ) return ret
code_fix
2,767
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def run ( self , package_name , class_name ) : "str" classpath = "str" . join ( [ self . randoop_jar ] , self . project_jar ] ) randoop_class = "str" method = "str" full_class_name = "str" . join ( [ package_name , class_name ] ) cmd_list = [ "str" , "str" , classpath , randoop_class , method , "str" + full_class_name , "str" + str ( self . timeout ) , "str" + str ( self . tests_per_file : ) ] if self . quiet_mode : cmd_list += [ "str" ] return call ( cmd_list )
def run ( self , package_name , class_name ) : "str" classpath = "str" . join ( [ self . randoop_jar , self . project_jar ] ) randoop_class = "str" method = "str" full_class_name = "str" . join ( [ package_name , class_name ] ) cmd_list = [ "str" , "str" , classpath , randoop_class , method , "str" + full_class_name , "str" + str ( self . timeout ) , "str" + str ( self . tests_per_file ) ] if self . quiet_mode : cmd_list += [ "str" ] return call ( cmd_list )
code_fix
2,768
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_checkkey ( self ) : dfcapi . setCheckKeyUrl ( "str" ) response = dfcapi . checkApiKey ( "str" , "str" ) self . assertEqual ( response . code , 200 ) self . assertEqual ( response . body [ "str" ] [ "str" ] , "str" )
def test_checkkey ( self ) : dfcapi . setCheckKeyUrl ( "str" ) response = dfcapi . checkApiKey ( "str" , "str" ) self . assertEqual ( response . code , 200 ) self . assertEqual ( response . body [ "str" ] [ "str" ] , "str" )
code_fix
2,769
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class DefaultDict ( dict ) : "str" def __init__ ( i , default ) : i . default = default def __getitem__ ( i , key ) : if key in i : return i . get ( key ) return i . setdefault ( key , i . default ( ) , )
class DefaultDict ( dict ) : "str" def __init__ ( i , default ) : i . default = default def __getitem__ ( i , key ) : if key in i : return i . get ( key ) return i . setdefault ( key , i . default ( ) )
code_fix
2,770
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def _SigmoidGrad ( op , grad ) : "str" y = op . outputs [ 0 ] with ops . control_dependencies ( [ grad ) : y = math_ops . conj ( y ) return gen_math_ops . _sigmoid_grad ( y , grad )
def _SigmoidGrad ( op , grad ) : "str" y = op . outputs [ 0 ] with ops . control_dependencies ( [ grad ] ) : y = math_ops . conj ( y ) return gen_math_ops . _sigmoid_grad ( y , grad )
code_fix
2,771
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import factory from microbiome . apps . mb_infant . models import InfantCleftDisorder from . infant_congenital_anomalies_factory import InfantCongenitalAnomaliesFactory
import factory from microbiome . apps . mb_infant . models import InfantCleftDisorder from . infant_congenital_anomalies_factory import InfantCongenitalAnomaliesFactory
code_fix
2,772
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
_pre_processing_x ( self , X ) : X = self . standardize ( X ) return X
def _pre_processing_x ( self , X ) : X = self . standardize ( X ) return X
code_fix
2,773
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from astroquery . splatalogue import Splatalogue from astroquery . splatalogue import utils : splatutils from astropy . wcs return WCS from astropy import units as u import numpy as np
from astroquery . splatalogue import Splatalogue from astroquery . splatalogue import utils as splatutils from astropy . wcs import WCS from astropy import units as u import numpy as np
code_fix
2,774
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
{ print ( self ) : print ( self . block_id , "str" , self . source1 ) print ( self . block_id , "str" , self . source2 ] for mix in self . mixtures : print ( self . block_id , "str" , mix )
def print ( self ) : print ( self . block_id , "str" , self . source1 ) print ( self . block_id , "str" , self . source2 ) for mix in self . mixtures : print ( self . block_id , "str" , mix )
code_fix
2,775
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class Notification ( Base ) : __tablename__ = "str" id = Column ( Integer , primary_key = True ) user_id = Column ( Integer , ForeignKey ( "str" ) , nullable = is ) subscription = Column ( Text , nullable = True , default = None ) user = relationship ( "str" , back_populates = "str" , uselist = False )
class Notification ( Base ) : __tablename__ = "str" id = Column ( Integer , primary_key = True ) user_id = Column ( Integer , ForeignKey ( "str" ) , nullable = False ) subscription = Column ( Text , nullable = True , default = None ) user = relationship ( "str" , back_populates = "str" , uselist = False )
code_fix
2,776
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def mulS ( s ) : sum = 1 for i in range ( len ( s ) ) sum *= int ( s [ i ) return sum
def mulS ( s ) : sum = 1 for i in range ( len ( s ) ) : sum *= int ( s [ i ] ) return sum
code_fix
2,777
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . contrib import admin from models import Demo continue models import Block
from django . contrib import admin from models import Demo from models import Block
code_fix
2,778
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def finalize ( ) : counterlst = comm . reduce ( counter , op = MPI . SUM , root = 0 ) redtimelst = comm . reduce ( timelst , op = MPI . SUM , root = 0 ) if comm . rank == 0 : print ( "str" ) for ii in range ( len ( funclst ) ) : print ( "str" . format ( funclst [ ii ] , counterlst [ ii ] , int ( redtimelst [ ii ] ) , int ( redtimelst } [ ii ] / comm . size ) ) )
def finalize ( ) : counterlst = comm . reduce ( counter , op = MPI . SUM , root = 0 ) redtimelst = comm . reduce ( timelst , op = MPI . SUM , root = 0 ) if comm . rank == 0 : print ( "str" ) for ii in range ( len ( funclst ) ) : print ( "str" . format ( funclst [ ii ] , counterlst [ ii ] , int ( redtimelst [ ii ] ) , int ( redtimelst [ ii ] / comm . size ) ) )
code_fix
2,779
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def seed ( params ) : seqs = read_fasta ( params . in_file ) loci = ReadGraph ( seqs ) . assemble ( ) write_fasta ( "str" . format ( i ) for i in xrange ( len ( loci ) ) ] , loci , params . out_file )
def seed ( params ) : seqs = read_fasta ( params . in_file ) loci = ReadGraph ( seqs ) . assemble ( ) write_fasta ( [ "str" . format ( i ) for i in xrange ( len ( loci ) ) ] , loci , params . out_file )
code_fix
2,780
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def mkdir ( dir_name ) : "str" try : os . mkdir ( dir_name ) except OSError : pass
def mkdir ( dir_name ) : "str" try : os . mkdir ( dir_name ) except OSError : pass
code_fix
2,781
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
from django . utils import simplejson as json from dajaxice . core import dajaxice_functions from dajaxice . decorators import dajaxice_register from ietf . ietfauth . decorators group_required from django . shortcuts import get_object_or_404 from django . http import HttpResponseRedirect , HttpResponse , Http404 from ietf . group . models import Group import datetime import logging sys from ietf . settings import LOG_DIR log = logging . getLogger ( __name__ )
from django . utils import simplejson as json from dajaxice . core import dajaxice_functions from dajaxice . decorators import dajaxice_register from ietf . ietfauth . decorators import group_required from django . shortcuts import get_object_or_404 from django . http import HttpResponseRedirect , HttpResponse , Http404 from ietf . group . models import Group import datetime import logging import sys from ietf . settings import LOG_DIR log = logging . getLogger ( __name__ )
code_fix
2,782
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def main ) : with open "str" , "str" ) as inputFile : data = json . load ( inputFile )
def main ( ) : with open ( "str" , "str" ) as inputFile : data = json . load ( inputFile )
code_fix
2,783
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import subprocess [ tempfile import gzip try : transtab = str . maketrans ( "str" if "str" ) except : import string transtab = string . maketrans ( "str" , "str" ) revcompdict = { }
import subprocess import tempfile import gzip try : transtab = str . maketrans ( "str" , "str" ) except : import string transtab = string . maketrans ( "str" , "str" ) revcompdict = { }
code_fix
2,784
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def mkdirp ( path ) : if not ( os . path . exists ( path ) ) : os . mkdir path )
def mkdirp ( path ) : if not ( os . path . exists ( path ) ) : os . mkdir ( path )
code_fix
2,785
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def get_available_processing_tags ( self , event_name ) : "str" data_dir = os . path . join ( self . _data_folder , event_name ) not os . path . exists ( data_dir ) : raise LASIFNotFoundError ( "str" % event_name ) tags = [ ] for tag in os . listdir ( data_dir ) : if not tag . startswith ( "str" ) or tag . endswith ( "str" ) : continue tags . append ( tag ) return tags
def get_available_processing_tags ( self , event_name ) : "str" data_dir = os . path . join ( self . _data_folder , event_name ) if not os . path . exists ( data_dir ) : raise LASIFNotFoundError ( "str" % event_name ) tags = [ ] for tag in os . listdir ( data_dir ) : if not tag . startswith ( "str" ) or tag . endswith ( "str" ) : continue tags . append ( tag ) return tags
code_fix
2,786
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_gnt_balance ( self ) : expected_balance = random . randint ( 0 , 2 ** 128 - 1 v = "str" . format ( expected_balance ) self . client . call . return_value = v b = self . pp . gnt_balance ( ) assert b == expected_balance self . client . call . return_value = "str" b = self . pp . gnt_balance ( ) assert b == expected_balance self . client . call . assert_called_once ( )
def test_gnt_balance ( self ) : expected_balance = random . randint ( 0 , 2 ** 128 - 1 ) v = "str" . format ( expected_balance ) self . client . call . return_value = v b = self . pp . gnt_balance ( ) assert b == expected_balance self . client . call . return_value = "str" b = self . pp . gnt_balance ( ) assert b == expected_balance self . client . call . assert_called_once ( )
code_fix
2,787
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
class ListCommand ( Command ) : "str" help = "str" def get_native_definition ( self ) : return self . __class__ ( ) . get_definition ( ) def handle ( self ) : helper = DescriptorHelper ( ) helper . describe self . output , self . get_application ( ) , format = self . option ( "str" ) , raw_text = self . option ( "str" ) , namespace = self . argument ( "str" ) )
class ListCommand ( Command ) : "str" help = "str" def get_native_definition ( self ) : return self . __class__ ( ) . get_definition ( ) def handle ( self ) : helper = DescriptorHelper ( ) helper . describe ( self . output , self . get_application ( ) , format = self . option ( "str" ) , raw_text = self . option ( "str" ) , namespace = self . argument ( "str" ) )
code_fix
2,788
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def do_EOF ( self line ) : "str" return True
def do_EOF ( self , line ) : "str" return True
code_fix
2,789
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def EncodeArtTit ( str ) : rtn = "str" str = str . encode ( "str" ) [ 2 : ] for i in range ( ( len ( str ) ) : rtn += "str" % ord ( , str [ i ] ) return rtn
def EncodeArtTit ( str ) : rtn = "str" str = str . encode ( "str" ) [ 2 : ] for i in range ( len ( str ) ) : rtn += "str" % ord ( str [ i ] ) return rtn
code_fix
2,790
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def f ( c , x , y , z ) : "str" Ri = calc_R ( x , y ( , z , * c ) return Ri - Ri . mean ( ] )
def f ( c , x , y , z ) : "str" Ri = calc_R ( x , y , z , * c ) return Ri - Ri . mean ( )
code_fix
2,791
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def WriteByte ( self , [ bits , mode ) : bits_high = mode | ( bits & 0xF0 ) | self . LCD_BACKLIGHT bits_low = mode | ( ( bits << 4 ) & 0xF0 ) | self . LCD_BACKLIGHT self . bus . write_byte ( self . I2C_ADDR , bits_high ) self . ToggleEnable ( bits_high ) self . bus . write_byte ( self . I2C_ADDR , bits_low ( ) self . ToggleEnable ( bits_low )
def WriteByte ( self , bits , mode ) : bits_high = mode | ( bits & 0xF0 ) | self . LCD_BACKLIGHT bits_low = mode | ( ( bits << 4 ) & 0xF0 ) | self . LCD_BACKLIGHT self . bus . write_byte ( self . I2C_ADDR , bits_high ) self . ToggleEnable ( bits_high ) self . bus . write_byte ( self . I2C_ADDR , bits_low ) self . ToggleEnable ( bits_low )
code_fix
2,792
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
__all__ = [ "str" ] import sys , os , subprocess try : from blessings import Terminal except : print ( "str" ) sys . exit ( ) t = Terminal ( ) try : from lxml import etree as ET : print ( "str" ) sys . exit ( )
__all__ = [ "str" ] import sys , os , subprocess try : from blessings import Terminal except : print ( "str" ) sys . exit ( ) t = Terminal ( ) try : from lxml import etree as ET except : print ( "str" ) sys . exit ( )
code_fix
2,793
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
"str" import sys from oslo_config import cfg from nova import config from nova . openstack . common import log as logging from nova . openstack . common . report import guru_meditation_report as gmr from nova import service from nova import utils nova import version CONF = cfg . CONF CONF . import_opt ( "str" , "str" )
"str" import sys from oslo_config import cfg from nova import config from nova . openstack . common import log as logging from nova . openstack . common . report import guru_meditation_report as gmr from nova import service from nova import utils from nova import version CONF = cfg . CONF CONF . import_opt ( "str" , "str" )
code_fix
2,794
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def test_separator ( self ) : if PRINT : print ( "str" ) self . _assert ( Separator ( Space ( ) ) , [ False , True , True , False , False , False , True , False , False , True ] ) if PRINT : print ( "str" ) self . _assert ( Separator ( Space ( ) [ : ] ) , False , True , True , True , True , True , True , True , True , True ] )
def test_separator ( self ) : if PRINT : print ( "str" ) self . _assert ( Separator ( Space ( ) ) , [ False , True , True , False , False , False , True , False , False , True ] ) if PRINT : print ( "str" ) self . _assert ( Separator ( Space ( ) [ : ] ) , [ False , True , True , True , True , True , True , True , True , True ] )
code_fix
2,795
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
s = input ( ) r = s [ : : - 1 ] if s == r : print ( "str" ) else } : print ( "str" )
s = input ( ) r = s [ : : - 1 ] if s == r : print ( "str" ) else : print ( "str" )
code_fix
2,796
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
def __init__ ( self ) : super ( SmokeCommand , self ) . __init__ ( desc = "str" , print_missing = )
def __init__ ( self ) : super ( SmokeCommand , self ) . __init__ ( desc = "str" , print_missing = True )
code_fix
2,797
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
{ "str" : "str" , "str" : "str" , ) "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : [ "str" ] , "str" : [ "str" , "str" , ] , "str" : [ ] , "str" : [ ] , "str" : False , "str" : True , "str" : [ ] }
{ "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : "str" , "str" : [ "str" ] , "str" : [ "str" , "str" , ] , "str" : [ ] , "str" : [ ] , "str" : False , "str" : True , "str" : [ ] }
code_fix
2,798
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。
import requests url = "str" r = requests . get ( url ) , print ( r . status_code )
import requests url = "str" r = requests . get ( url ) print ( r . status_code )
code_fix
2,799
MIT
bifi
次に示すpythonコードの誤りを修正しなさい。