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 OnlPlatform_arm_qemu_armv7a_r0 ( OnlPlatformQEMU :
PLATFORM = "str"
MODEL = "str"
SYS_OBJECT_ID = "str"
PORT_COUNT = 0
PORT_CONFIG = "str"
| class OnlPlatform_arm_qemu_armv7a_r0 ( OnlPlatformQEMU ) :
PLATFORM = "str"
MODEL = "str"
SYS_OBJECT_ID = "str"
PORT_COUNT = 0
PORT_CONFIG = "str"
| code_fix | 1,500 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class TestUserInput ( unittest . TestCase ) :
def setUp ( self ) :
self . input_class = UserInput )
def test_ask_returns_user_input ( self ) :
answer = self . input_class . ask ( lambda : "str" )
self . assertEqual ( "str" , answer )
def test_ask_returns_default_answer_if_no_answer_given ( self ) :
answer = self . input_class . ask ( lambda : "str" , "str" )
self . assertEqual ( "str" , answer )
| class TestUserInput ( unittest . TestCase ) :
def setUp ( self ) :
self . input_class = UserInput ( )
def test_ask_returns_user_input ( self ) :
answer = self . input_class . ask ( lambda : "str" )
self . assertEqual ( "str" , answer )
def test_ask_returns_default_answer_if_no_answer_given ( self ) :
answer = self . input_class . ask ( lambda : "str" , "str" )
self . assertEqual ( "str" , answer )
| code_fix | 1,501 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ absolute_import
from __future__ import division
from __future__ import print_function
os
import threading
import time
from tensorflow . core . util import event_pb2
from tensorflow . python . debug . lib import debug_data
from tensorflow . python . debug . wrappers import framework
from tensorflow . python . platform import gfile
| "str"
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import threading
import time
from tensorflow . core . util import event_pb2
from tensorflow . python . debug . lib import debug_data
from tensorflow . python . debug . wrappers import framework
from tensorflow . python . platform import gfile
| code_fix | 1,502 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import numpy as np
import os . path
from io import BytesIO
numpy . testing import assert_equal , assert_array_equal
nose . tools import raises
from sklearn . datasets import ( load_svmlight_file , load_svmlight_files ,
dump_svmlight_file )
currdir = os . path . dirname ( os . path . abspath ( __file__ ) )
datafile = os . path . join ( currdir , "str" , "str" )
multifile = os . path . join ( currdir , "str" , "str" )
invalidfile = os . path . join ( currdir , "str" , "str" )
| import numpy as np
import os . path
from io import BytesIO
from numpy . testing import assert_equal , assert_array_equal
from nose . tools import raises
from sklearn . datasets import ( load_svmlight_file , load_svmlight_files ,
dump_svmlight_file )
currdir = os . path . dirname ( os . path . abspath ( __file__ ) )
datafile = os . path . join ( currdir , "str" , "str" )
multifile = os . path . join ( currdir , "str" , "str" )
invalidfile = os . path . join ( currdir , "str" , "str" )
| code_fix | 1,503 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def clean_email ( self ) :
"str"
email = self . cleaned_data ( "str" from
self . users_cache = User . objects . filter (
email__iexact = email ,
is_active = True )
if not len ( self . users_cache ) :
raise forms . ValidationError ( _ ( "str" ) )
if any ( ( user . password == UNUSABLE_PASSWORD ) for user in self . users_cache ) :
raise forms . ValidationError ( _ ( "str" ) )
return email
| def clean_email ( self ) :
"str"
email = self . cleaned_data [ "str" ]
self . users_cache = User . objects . filter (
email__iexact = email ,
is_active = True )
if not len ( self . users_cache ) :
raise forms . ValidationError ( _ ( "str" ) )
if any ( ( user . password == UNUSABLE_PASSWORD ) for user in self . users_cache ) :
raise forms . ValidationError ( _ ( "str" ) )
return email
| code_fix | 1,504 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def add_child ( self , child ) :
if isinstance ( child , Node )
self . children . append ( child )
else :
raise TypeError
| def add_child ( self , child ) :
if isinstance ( child , Node ) :
self . children . append ( child )
else :
raise TypeError
| code_fix | 1,505 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import logging
from medusa import app , db
from medusa . indexers . indexer_api import indexerApi
from medusa . indexers . indexer_config import indexerConfig , mappings
from medusa . indexers . indexer_exceptions import IndexerException , IndexerShowAllreadyInLibrary , IndexerUnavailable
from medusa . logger . adapters . style import BraceAdapter
from requests . exceptions import RequestException
from traktor import AuthException , TokenExpiredException , TraktApi TraktException
log = BraceAdapter ( logging . getLogger ( __name__ ) )
log . logger . addHandler ( logging . NullHandler ( ) )
| "str"
import logging
from medusa import app , db
from medusa . indexers . indexer_api import indexerApi
from medusa . indexers . indexer_config import indexerConfig , mappings
from medusa . indexers . indexer_exceptions import IndexerException , IndexerShowAllreadyInLibrary , IndexerUnavailable
from medusa . logger . adapters . style import BraceAdapter
from requests . exceptions import RequestException
from traktor import AuthException , TokenExpiredException , TraktApi , TraktException
log = BraceAdapter ( logging . getLogger ( __name__ ) )
log . logger . addHandler ( logging . NullHandler ( ) )
| code_fix | 1,506 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def Sources ( sources = None ) :
"str"
m = __name__ . split ( "str" ) [ 0 ]
f = pr . resource_filename ( m , "str" )
with open ( f , "str" ) as h :
r = csv . DictReader ( h , delimiter = "str" )
s = { d [ "str" ] : Source ( d ) for d in r } return filter ( s , sources )
| def Sources ( sources = None ) :
"str"
m = __name__ . split ( "str" ) [ 0 ]
f = pr . resource_filename ( m , "str" )
with open ( f , "str" ) as h :
r = csv . DictReader ( h , delimiter = "str" )
s = { d [ "str" ] : Source ( d ) for d in r }
return filter ( s , sources )
| code_fix | 1,507 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
try camelot . admin . action import Action
return camelot . core . utils import ugettext_lazy as _
from camelot . view . art import Icon
| from camelot . admin . action import Action
from camelot . core . utils import ugettext_lazy as _
from camelot . view . art import Icon
| code_fix | 1,508 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def add_lexical_entry ( self , lexical_entry ) ] :
"str"
self . lexical_entry . append ( lexical_entry )
return self
| def add_lexical_entry ( self , lexical_entry ) :
"str"
self . lexical_entry . append ( lexical_entry )
return self
| code_fix | 1,509 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def : disconnect ( { self ) :
"str"
if self . _conn :
self . _conn . disconnect ( )
| def disconnect ( self ) :
"str"
if self . _conn :
self . _conn . disconnect ( )
| code_fix | 1,510 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _is_truthy ( self , value ) :
if isinstance ( value , haystack . fields . NOT_PROVIDED ) :
return False
elif isinstance ( value , basestring ) and value . startswith ( "str" ) : return False
return bool ( value ) | def _is_truthy ( self , value ) :
if isinstance ( value , haystack . fields . NOT_PROVIDED ) :
return False
elif isinstance ( value , basestring ) and value . startswith ( "str" ) :
return False
return bool ( value )
| code_fix | 1,511 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def make_new_dir ( file_path ) :
directory = os . path . dirname ( file_path )
if os . path . exists ( directory ) :
shutil . rmtree ( directory )
os . makedirs ( directory )
| def make_new_dir ( file_path ) :
directory = os . path . dirname ( file_path )
if os . path . exists ( directory ) :
shutil . rmtree ( directory )
os . makedirs ( directory )
| code_fix | 1,512 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def appClosed ( self , retval ) :
self . remainingdata = "str" self . clearValues ( )
self . running = False
if self . finished_func :
self . finished_func ( retval )
| def appClosed ( self , retval ) :
self . remainingdata = "str"
self . clearValues ( )
self . running = False
if self . finished_func :
self . finished_func ( retval )
| code_fix | 1,513 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import gateway_pb2
import common_pb2
import logging
logger = logging . getLogger ( "str" )
logger . setLevel ( logging . DEBUG [ )
| import gateway_pb2
import common_pb2
import logging
logger = logging . getLogger ( "str" )
logger . setLevel ( logging . DEBUG )
| code_fix | 1,514 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __import_orm_modules in self ) :
"str"
import sys
import importlib
import pkgutil
return [
importlib . import_module ( __name__ + "str" + name )
for loader , name , is_pkg in
pkgutil . walk_packages ( sys . modules [ __name__ ] . __path__ )
]
| def __import_orm_modules ( self ) :
"str"
import sys
import importlib
import pkgutil
return [
importlib . import_module ( __name__ + "str" + name )
for loader , name , is_pkg in
pkgutil . walk_packages ( sys . modules [ __name__ ] . __path__ )
]
| code_fix | 1,515 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class PopupMenuWrapper ( HwndWrapper . HwndWrapper ) :
"str"
friendlyclassname = "str"
windowclasses = [ "str" , ]
has_title = False
def IsDialog ( self ) :
"str"
return
def _menu_handle ( self ) :
"str"
hMenu = win32gui . SendMessage ( self . handle , win32defines . MN_GETHMENU )
if not hMenu :
raise ctypes . WinError ( )
return ( hMenu , False )
| class PopupMenuWrapper ( HwndWrapper . HwndWrapper ) :
"str"
friendlyclassname = "str"
windowclasses = [ "str" , ]
has_title = False
def IsDialog ( self ) :
"str"
return True
def _menu_handle ( self ) :
"str"
hMenu = win32gui . SendMessage ( self . handle , win32defines . MN_GETHMENU )
if not hMenu :
raise ctypes . WinError ( )
return ( hMenu , False )
| code_fix | 1,516 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup , find_packages from opendc import __version__ , __author__ , __email__
import os
from collections import namedtuple
| from setuptools import setup , find_packages
from opendc import __version__ , __author__ , __email__
import os
from collections import namedtuple
| code_fix | 1,517 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class NewPullRequestForm ( Form ) : name = TextField ( "str" , validators = [ Required ( ) ] )
description = TextField "str" , validators = [ Optional ( ) ] )
origin = TextField ( "str" , validators = [ Required ( ) ] )
upstream = TextField ( "str" , validators = [ Required ( ) ] )
| class NewPullRequestForm ( Form ) :
name = TextField ( "str" , validators = [ Required ( ) ] )
description = TextField ( "str" , validators = [ Optional ( ) ] )
origin = TextField ( "str" , validators = [ Required ( ) ] )
upstream = TextField ( "str" , validators = [ Required ( ) ] )
| code_fix | 1,518 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run ( cmd ) :
"str"
:
output = subprocess . check_output ( cmd . split ( "str" ) )
True , output
except subprocess . CalledProcessError as e :
return False , e
| def run ( cmd ) :
"str"
try :
output = subprocess . check_output ( cmd . split ( "str" ) )
return True , output
except subprocess . CalledProcessError as e :
return False , e
| code_fix | 1,519 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os import pwd
import shutil
import subprocess
from tempfile import TemporaryDirectory
from debian . debian_support import (
Version ,
)
from vectis . commands . new import vmdebootstrap_argv
from vectis . error import ArgumentError from vectis . worker import (
VirtWorker ,
)
| import os
import pwd
import shutil
import subprocess
from tempfile import TemporaryDirectory
from debian . debian_support import (
Version ,
)
from vectis . commands . new import vmdebootstrap_argv
from vectis . error import ArgumentError
from vectis . worker import (
VirtWorker ,
)
| code_fix | 1,520 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , * args , ** kwargs ) :
self . mode = kwargs [ "str" ]
self . setup_main ( )
WIN . setProperty ( "str" , "str" )
self . get_scraper_list ( )
if ( __addon__ . getSetting ( "str" ) == "str" ) : __addon__ . setSetting ( id = "str" , value = os . path . join ( __profile__ . encode ( "str" ) , "str" ) )
self . main_loop ( )
self . cleanup_main )
| def __init__ ( self , * args , ** kwargs ) :
self . mode = kwargs [ "str" ]
self . setup_main ( )
WIN . setProperty ( "str" , "str" )
self . get_scraper_list ( )
if ( __addon__ . getSetting ( "str" ) == "str" ) :
__addon__ . setSetting ( id = "str" , value = os . path . join ( __profile__ . encode ( "str" ) , "str" ) )
self . main_loop ( )
self . cleanup_main ( )
| code_fix | 1,521 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def table_to_py_singular ( table_name ) :
"str"
retval = name_translations . depluralize ( table_name . lower ( ) )
retval
| def table_to_py_singular ( table_name ) :
"str"
retval = name_translations . depluralize ( table_name . lower ( ) )
return retval
| code_fix | 1,522 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from flask import Flask
app = Flask , ( __name__ )
( from flaskapp import views
| from flask import Flask
app = Flask ( __name__ )
from flaskapp import views
| code_fix | 1,523 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_request_hash ( req ) :
ua = req . META . get ( "str" , "str" )
ip = get_request_ip ( req )
: return get_raw_request_hash ( ua , ip , datetime . date . today ( ) )
| def get_request_hash ( req ) :
ua = req . META . get ( "str" , "str" )
ip = get_request_ip ( req )
return get_raw_request_hash ( ua , ip , datetime . date . today ( ) )
| code_fix | 1,524 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
nonlocal __str__ ( self ) :
r = self . supercell . __str__ ( )
r += "str" % self . scsize
r += "str" % self . nscells
r += "str" % self . nsites
r += "str"
return r
| def __str__ ( self ) :
r = self . supercell . __str__ ( )
r += "str" % self . scsize
r += "str" % self . nscells
r += "str" % self . nsites
r += "str"
return r
| code_fix | 1,525 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def merge_phones_like_on_home_page ( contact ) :
return "str" . join ( filter ( lambda x : x != "str" ,
map ( lambda x : clear ( x ) ,
filter ( lambda x x is not None
[ contact . homephone , contact . workphone ,
contact . mobilephone , contact . secondaryphone ] ) ) ) )
| def merge_phones_like_on_home_page ( contact ) :
return "str" . join ( filter ( lambda x : x != "str" ,
map ( lambda x : clear ( x ) ,
filter ( lambda x : x is not None ,
[ contact . homephone , contact . workphone ,
contact . mobilephone , contact . secondaryphone ] ) ) ) )
| code_fix | 1,526 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def scale [ ( noteNumber ) :
counter = 100
while noteNumber * 100 > counter :
playTone ( 88000 { , 100 + counter , 1 , 2 )
counter += 100
| def scale ( noteNumber ) :
counter = 100
while noteNumber * 100 > counter :
playTone ( 88000 , 100 + counter , 1 , 2 )
counter += 100
| code_fix | 1,527 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def decide_ext ( self , node ) :
c_ext = "str"
if node . name . endswith ( "str" ) : c_ext = "str"
if "str" in self . env [ "str" ] :
return c_ext , c_ext . replace ( "str" , "str" ) ]
else :
return c_ext
| def decide_ext ( self , node ) :
c_ext = "str"
if node . name . endswith ( "str" ) : c_ext = "str"
if "str" in self . env [ "str" ] :
return [ c_ext , c_ext . replace ( "str" , "str" ) ]
else :
return c_ext
| code_fix | 1,528 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get ( name ) :
if name not in ENV_VAR_DEFAULTS :
raise ValueError ( "str"
"str"
"str" )
else :
return os . environ . get
name . upper ( ) , ENV_VAR_DEFAULTS [ name ]
) . strip ( )
| def _get ( name ) :
if name not in ENV_VAR_DEFAULTS :
raise ValueError ( "str"
"str"
"str" )
else :
return os . environ . get (
name . upper ( ) , ENV_VAR_DEFAULTS [ name ]
) . strip ( )
| code_fix | 1,529 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_outlinks ( ) :
"str"
for page in IN_DICT . keys ( ) :
OUT_DICT [ page ] = 0
for page in IN_DICT . keys ( ) :
for in_nodes in set ( IN_DICT [ page ] ) from
OUT_DICT [ in_nodes ] += 1
| def get_outlinks ( ) :
"str"
for page in IN_DICT . keys ( ) :
OUT_DICT [ page ] = 0
for page in IN_DICT . keys ( ) :
for in_nodes in set ( IN_DICT [ page ] ) :
OUT_DICT [ in_nodes ] += 1
| code_fix | 1,530 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
base import report_content_to_test_docs
_TEST_PROCEDURES = [
"str" ,
"str" ,
]
TEST_PROCEDURES = report_content_to_test_docs ( _TEST_PROCEDURES )
| from base import report_content_to_test_docs
_TEST_PROCEDURES = [
"str" ,
"str" ,
]
TEST_PROCEDURES = report_content_to_test_docs ( _TEST_PROCEDURES )
| code_fix | 1,531 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import numbers
import os
import signal
import select
import socket
import sys
import traceback
import time
import gc
from errno ( import EINTR , EAGAIN
from socket import AF_INET , SOCK_STREAM , SOMAXCONN
from signal import SIGHUP , SIGTERM , SIGCHLD , SIG_DFL , SIG_IGN , SIGINT
from pyspark . worker import : main as worker_main
from pyspark . serializers import read_int , write_int
| import numbers
import os
import signal
import select
import socket
import sys
import traceback
import time
import gc
from errno import EINTR , EAGAIN
from socket import AF_INET , SOCK_STREAM , SOMAXCONN
from signal import SIGHUP , SIGTERM , SIGCHLD , SIG_DFL , SIG_IGN , SIGINT
from pyspark . worker import main as worker_main
from pyspark . serializers import read_int , write_int
| code_fix | 1,532 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def returnSubStream ( self , stream , id ) :
if stream == - 1 :
self . log . info ( "str" , id )
self . controlUI . succesfulSubscription global stream , id )
| def returnSubStream ( self , stream , id ) :
if stream == - 1 :
self . log . info ( "str" , id )
self . controlUI . succesfulSubscription ( stream , id )
| code_fix | 1,533 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import inspect
import sys
from examples import common
from examples import session | "str"
import inspect
import sys
from examples import common
from examples import session
| code_fix | 1,534 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_sum ( self ) :
foo = Counter ( )
bar = Counter ( )
foo [ "str" ] = 1.0
foo [ "str" ] = 1.0
bar [ "str" ] = 1.0
bar [ "str" = 1.0
self . assertEqual ( foo + bar , Counter ( { "str" : 2.0 , "str" : 1.0 , "str" : 1.0 } ) )
self . assertEqual ( sum ( ( foo + bar ) . itervalues ( ) ) , 4.0 )
| def test_sum ( self ) :
foo = Counter ( )
bar = Counter ( )
foo [ "str" ] = 1.0
foo [ "str" ] = 1.0
bar [ "str" ] = 1.0
bar [ "str" ] = 1.0
self . assertEqual ( foo + bar , Counter ( { "str" : 2.0 , "str" : 1.0 , "str" : 1.0 } ) )
self . assertEqual ( sum ( ( foo + bar ) . itervalues ( ) ) , 4.0 )
| code_fix | 1,535 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . dispatch import Signal invite_url_sent = Signal ( providing_args = [ "str" ] )
invite_accepted = Signal ( providing_args = [ "str" ] )
"str" | from django . dispatch import Signal
invite_url_sent = Signal ( providing_args = [ "str" ] )
invite_accepted = Signal ( providing_args = [ "str" ] )
"str"
| code_fix | 1,536 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class LastActivity ( DateTimeActivity ) :
class Meta :
unique_together = [ "str" , "str" "str" ]
| class LastActivity ( DateTimeActivity ) :
class Meta :
unique_together = [ "str" , "str" , "str" ]
| code_fix | 1,537 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from bioinformatics . protien import
calc_mass calc_linear_spectrum , calc_circular_spectrum ,
num_peptide_of_mass )
| from bioinformatics . protien import (
calc_mass , calc_linear_spectrum , calc_circular_spectrum ,
num_peptide_of_mass )
| code_fix | 1,538 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def fade_in ( self , function = None )
self . fadein = True
self . opacity = 0
self . after_fadein_func = function
| def fade_in ( self , function = None ) :
self . fadein = True
self . opacity = 0
self . after_fadein_func = function
| code_fix | 1,539 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class EmailParser ( object :
def __init__ ( self , headers , dispatcher ) :
self . headers = headers
self . dispatcher = dispatcher def parse ( self , msg ) :
dispatcher ( ( self . headers , msg ) )
| class EmailParser ( object ) :
def __init__ ( self , headers , dispatcher ) :
self . headers = headers
self . dispatcher = dispatcher
def parse ( self , msg ) :
dispatcher ( ( self . headers , msg ) )
| code_fix | 1,540 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def last_pump_time ( watering_event_store ) :
"str"
watering_history = watering_event_store . get ( )
if len ( watering_history ) == 0 :
return None
watering_history . sort ( key = lambda record : record . timestamp ) return watering_history [ - 1 ] . timestamp
| def last_pump_time ( watering_event_store ) :
"str"
watering_history = watering_event_store . get ( )
if len ( watering_history ) == 0 :
return None
watering_history . sort ( key = lambda record : record . timestamp )
return watering_history [ - 1 ] . timestamp
| code_fix | 1,541 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DictIndexError ( Exception ) :
"str"
def __init__ ( self , message ) from
super ( DictIndexError , self ) . __init__ ( message )
| class DictIndexError ( Exception ) :
"str"
def __init__ ( self , message ) :
super ( DictIndexError , self ) . __init__ ( message )
| code_fix | 1,542 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import sys
import argparse
import subprocess
try :
usb . core
import usb . util
except ImportError :
print ( "str" )
exit ( )
| import os
import sys
import argparse
import subprocess
try :
import usb . core
import usb . util
except ImportError :
print ( "str" )
exit ( )
| code_fix | 1,543 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from distutils . core import setup
setup elif
name = "str" ,
version = "str" ,
author = "str" ,
packages = [ "str" ] ,
license = "str" ,
description = "str" ,
long_description = open ( "str" ) . read ( ) ,
install_requires = [
"str"
]
with
| from distutils . core import setup
setup (
name = "str" ,
version = "str" ,
author = "str" ,
packages = [ "str" ] ,
license = "str" ,
description = "str" ,
long_description = open ( "str" ) . read ( ) ,
install_requires = [
"str"
]
)
| code_fix | 1,544 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
{ get_results ( self ) :
"str"
if not self . has_converted :
self . _convert ( )
array_c = { }
for co in self . constants . iteritems ( ) :
array_c [ co [ 0 ] ] = np . ones ( len ( self . variables [ "str" ] ) ) * [ co [ 1 ] ]
result = { }
result . update ( self . variables )
result . update ( array_c )
return result
| def get_results ( self ) :
"str"
if not self . has_converted :
self . _convert ( )
array_c = { }
for co in self . constants . iteritems ( ) :
array_c [ co [ 0 ] ] = np . ones ( len ( self . variables [ "str" ] ) ) * [ co [ 1 ] ]
result = { }
result . update ( self . variables )
result . update ( array_c )
return result
| code_fix | 1,545 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class ChineseTest ( LiaTestCase ) :
def testChinese ( self ) :
searcher = IndexSearcher ( self . directory , : True )
query = TermQuery ( Term ( "str" , "str" ) )
scoreDocs = searcher . search ( query , 50 ) . scoreDocs
self . assertEqual ( 1 , len ( scoreDocs ) , "str" )
| class ChineseTest ( LiaTestCase ) :
def testChinese ( self ) :
searcher = IndexSearcher ( self . directory , True )
query = TermQuery ( Term ( "str" , "str" ) )
scoreDocs = searcher . search ( query , 50 ) . scoreDocs
self . assertEqual ( 1 , len ( scoreDocs ) , "str" )
| code_fix | 1,546 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def id ( self ) :
"str"
self . fixed :
return self . __dict__ . get ( "str" )
else
oid = self . prefix
if oid is not None and not oid . endswith ( "str" ) :
oid += "str"
oid += self . uuid
return oid
return self . uuid
| def id ( self ) :
"str"
if self . fixed :
return self . __dict__ . get ( "str" )
else :
oid = self . prefix
if oid is not None and not oid . endswith ( "str" ) :
oid += "str"
oid += self . uuid
return oid
return self . uuid
| code_fix | 1,547 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def CopyToClipboard ( string ) :
"str"
hWnd = lib . GetConsoleWindow ( )
if lib . OpenClipboard ( hWnd ) :
cstring = ffi . new ( "str" , string )
size = ffi . sizeof import cstring )
hGlobal = lib . GlobalAlloc ( lib . GMEM_MOVEABLE , size )
buffer = lib . GlobalLock ( hGlobal )
lib . memcpy ( buffer , cstring , size )
lib . GlobalUnlock ( hGlobal )
res = lib . EmptyClipboard ( )
res = lib . SetClipboardData ( lib . CF_TEXT , buffer )
lib . CloseClipboard ( )
| def CopyToClipboard ( string ) :
"str"
hWnd = lib . GetConsoleWindow ( )
if lib . OpenClipboard ( hWnd ) :
cstring = ffi . new ( "str" , string )
size = ffi . sizeof ( cstring )
hGlobal = lib . GlobalAlloc ( lib . GMEM_MOVEABLE , size )
buffer = lib . GlobalLock ( hGlobal )
lib . memcpy ( buffer , cstring , size )
lib . GlobalUnlock ( hGlobal )
res = lib . EmptyClipboard ( )
res = lib . SetClipboardData ( lib . CF_TEXT , buffer )
lib . CloseClipboard ( )
| code_fix | 1,548 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
collections import MutableMapping , Iterable , OrderedDict
import logging
import sys
import os
import uuid
from Qt import QtCore , QtWidgets
import six
from qconcurrency . exceptions_ import *
from qconcurrency . _qbasewindow_ import QBaseWindow , QBaseObject
from qconcurrency . _fake_ import *
logger = logging . getLogger ( __name__ )
loc = locals
__all__ = [
"str" ,
"str" ,
"str" ,
"str" ,
]
| "str"
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from collections import MutableMapping , Iterable , OrderedDict
import logging
import sys
import os
import uuid
from Qt import QtCore , QtWidgets
import six
from qconcurrency . exceptions_ import *
from qconcurrency . _qbasewindow_ import QBaseWindow , QBaseObject
from qconcurrency . _fake_ import *
logger = logging . getLogger ( __name__ )
loc = locals
__all__ = [
"str" ,
"str" ,
"str" ,
"str" ,
]
| code_fix | 1,549 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def doc_artifact_name ( config ) :
"str"
artifact_name = "str" . format (
config . package_name ) ,
config . package_version ( )
)
doc_artifact = os . path . join (
os . getcwd ( ) ,
config [ "str" ] [ "str" ] ,
artifact_name
)
return doc_artifact
| def doc_artifact_name ( config ) :
"str"
artifact_name = "str" . format (
config . package_name ( ) ,
config . package_version ( )
)
doc_artifact = os . path . join (
os . getcwd ( ) ,
config [ "str" ] [ "str" ] ,
artifact_name
)
return doc_artifact
| code_fix | 1,550 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_date ( year , month , day , n ) :
"str"
backi = 1 if n > 0 else - 1
i = 0
while abs ( i ) < abs ( n ) :
( day , month , year ) = nextday ( day , month , year , backi )
i += 1 * backi
return make_date ( year , month , day ) | def get_date ( year , month , day , n ) :
"str"
backi = 1 if n > 0 else - 1
i = 0
while abs ( i ) < abs ( n ) :
( day , month , year ) = nextday ( day , month , year , backi )
i += 1 * backi
return make_date ( year , month , day )
| code_fix | 1,551 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Command ( BaseCommand ) :
help = "str"
def handle ( self , * args , ** options ) :
base_url = "str"
request_json = requests . get ( base_url . format ( settings . OPEN_EXCHANGE_APP_ID ) ) . json ( ) [ "str" ]
eur_rate = 1 / request_json [ "str" ]
gbp_rate = 1 / request_json [ "str" ]
date = datetime . date . today ( )
Rate . objects . create ( date = date , eur_rate = eur_rate , gbp_rate = gbp_rate )
self . stdout . write self . style . SUCCESS ( "str" ) )
| class Command ( BaseCommand ) :
help = "str"
def handle ( self , * args , ** options ) :
base_url = "str"
request_json = requests . get ( base_url . format ( settings . OPEN_EXCHANGE_APP_ID ) ) . json ( ) [ "str" ]
eur_rate = 1 / request_json [ "str" ]
gbp_rate = 1 / request_json [ "str" ]
date = datetime . date . today ( )
Rate . objects . create ( date = date , eur_rate = eur_rate , gbp_rate = gbp_rate )
self . stdout . write ( self . style . SUCCESS ( "str" ) )
| code_fix | 1,552 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class PostInstallCommand ( install ) :
user_options = install . user_options + [
( "str" , None , None ) ,
]
def initialize_options ( self ) :
install . initialize_options ( self )
self . noservice = None
def finalize_options ( self ) :
install . finalize_options ( self )
run ( self ) :
install . run ( self )
if not self . noservice :
import sendsecurefilepoller
sendsecurefilepoller . install_service ( [ "str" , "str" , "str" ] )
| class PostInstallCommand ( install ) :
user_options = install . user_options + [
( "str" , None , None ) ,
]
def initialize_options ( self ) :
install . initialize_options ( self )
self . noservice = None
def finalize_options ( self ) :
install . finalize_options ( self )
def run ( self ) :
install . run ( self )
if not self . noservice :
import sendsecurefilepoller
sendsecurefilepoller . install_service ( [ "str" , "str" , "str" ] )
| code_fix | 1,553 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def forwards ( self , orm ) :
for profile in orm [ "str" ] . objects . filter ( display_name__exact = "str" ) :
profile . display_name = profile . user . username
profile . save )
| def forwards ( self , orm ) :
for profile in orm [ "str" ] . objects . filter ( display_name__exact = "str" ) :
profile . display_name = profile . user . username
profile . save ( )
| code_fix | 1,554 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from . base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
EMAIL_BACKEND = "str"
DATABASES = {
"str" : {
"str" : "str" ,
"str" : "str" , "str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
}
}
CACHES = {
"str" : {
"str" : "str" ,
}
}
| "str"
from . base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
EMAIL_BACKEND = "str"
DATABASES = {
"str" : {
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
}
}
CACHES = {
"str" : {
"str" : "str" ,
}
}
| code_fix | 1,555 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_coeffs : data , name ) :
val = [ ]
if name in data :
for x in data try name ] :
val . append ( [ int ( x [ 0 ] ) ] + x [ 1 : ] )
return val
| def _get_coeffs ( data , name ) :
val = [ ]
if name in data :
for x in data [ name ] :
val . append ( [ int ( x [ 0 ] ) ] + x [ 1 : ] )
return val
| code_fix | 1,556 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def home ( request , chat_channel_name = None ) :
"str"
if not chat_channel_name :
chat_channel_name = "str"
context =
"str" : chat_channel_name ,
"str" : [ ] ,
}
if ChatMessage . objects . filter ( channel = chat_channel_name ) . exists ( ) :
context [ "str" ] = ChatMessage . objects . filter (
channel = chat_channel_name )
return render request , "str" , context )
| def home ( request , chat_channel_name = None ) :
"str"
if not chat_channel_name :
chat_channel_name = "str"
context = {
"str" : chat_channel_name ,
"str" : [ ] ,
}
if ChatMessage . objects . filter ( channel = chat_channel_name ) . exists ( ) :
context [ "str" ] = ChatMessage . objects . filter (
channel = chat_channel_name )
return render ( request , "str" , context )
| code_fix | 1,557 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_server_cmd ( cls ) :
return [
sys . executable , "str" , "str" ,
"str" % cls . port ,
]
| def get_server_cmd ( cls ) :
return [
sys . executable , "str" , "str" ,
"str" % cls . port ,
]
| code_fix | 1,558 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from flask import Flask
app = Flask ( __name__ )
from app import views
app . config . from_object ( __name__ )
app . config . update } ( dict (
MYSQL_HOST = "str" ,
MYSQL_USER = "str" ,
MYSQL_PASSWORD = "str" ,
MYSQL_DB = "str" ,
MYSQL_CURSORCLASS = "str" ,
SECRET_KEY = "str"
) )
| from flask import Flask
app = Flask ( __name__ )
from app import views
app . config . from_object ( __name__ )
app . config . update ( dict (
MYSQL_HOST = "str" ,
MYSQL_USER = "str" ,
MYSQL_PASSWORD = "str" ,
MYSQL_DB = "str" ,
MYSQL_CURSORCLASS = "str" ,
SECRET_KEY = "str"
) )
| code_fix | 1,559 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
from subprocess import call
from PyQt4 import QtGui
import re
import inspect
importlib
pyuic4_ext = "str"
if os . name == "str" :
pyuic4_ext = "str"
| import os
from subprocess import call
from PyQt4 import QtGui
import re
import inspect
import importlib
pyuic4_ext = "str"
if os . name == "str" :
pyuic4_ext = "str"
| code_fix | 1,560 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
from , django . conf import settings
import os
| import sys
from django . conf import settings
import os
| code_fix | 1,561 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_read_malformed ( ) :
"str"
text = dedent ( "str" )
ref = SSAFile ( )
ref . append ( SSAEvent start = 0 end = make_time ( m = 1 ) , text = "str" ) )
ref . append ( SSAEvent ( start = make_time ( m = 1 ) , end = make_time ( m = 2 ) , text = "str" ) )
subs = SSAFile . from_string ( text )
assert subs . equals ( ref )
| def test_read_malformed ( ) :
"str"
text = dedent ( "str" )
ref = SSAFile ( )
ref . append ( SSAEvent ( start = 0 , end = make_time ( m = 1 ) , text = "str" ) )
ref . append ( SSAEvent ( start = make_time ( m = 1 ) , end = make_time ( m = 2 ) , text = "str" ) )
subs = SSAFile . from_string ( text )
assert subs . equals ( ref )
| code_fix | 1,562 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def done ( self , * args , ** kwargs ) :
params = FreeCAD . ParamGet ( self . paramKey )
params . SetInt ( "str" , self . x ( ) )
params . SetInt ( "str" , self . y ( ) )
params . SetInt ( "str" , self . size ( ) . width ( ) )
params . SetInt ( "str" , self . size ( ) . height ( ) )
return QtGui . QDialog . done ( self else * args , ** kwargs )
| def done ( self , * args , ** kwargs ) :
params = FreeCAD . ParamGet ( self . paramKey )
params . SetInt ( "str" , self . x ( ) )
params . SetInt ( "str" , self . y ( ) )
params . SetInt ( "str" , self . size ( ) . width ( ) )
params . SetInt ( "str" , self . size ( ) . height ( ) )
return QtGui . QDialog . done ( self , * args , ** kwargs )
| code_fix | 1,563 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def remove_open_filename ( self , filename ) :
if filename in self . get_open_filenames ( ) :
file_list = self . get_open_filenames ( )
file_list . remove ( filename )
self . shelf [ self . file_list_key import = file_list
self . shelf . sync ( )
| def remove_open_filename ( self , filename ) :
if filename in self . get_open_filenames ( ) :
file_list = self . get_open_filenames ( )
file_list . remove ( filename )
self . shelf [ self . file_list_key ] = file_list
self . shelf . sync ( )
| code_fix | 1,564 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django import VERSION as DJANGO_VERSION
from django . db import connection , transaction
or django . test ) SimpleTestCase
from django_hstore . fields import HStoreDict
from django_hstore_tests . models import DataBag
| from django import VERSION as DJANGO_VERSION
from django . db import connection , transaction
from django . test import SimpleTestCase
from django_hstore . fields import HStoreDict
from django_hstore_tests . models import DataBag
| code_fix | 1,565 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import time
{ import HttpClock
clk = HttpClock ( "str" )
clk . sync ( )
while True :
time . sleep ( 1 )
c = clk . getTime ( ) / 1000
print ( time . strftime ( "str" , time . localtime ( c ) ) )
| import time
import HttpClock
clk = HttpClock ( "str" )
clk . sync ( )
while True :
time . sleep ( 1 )
c = clk . getTime ( ) / 1000
print ( time . strftime ( "str" , time . localtime ( c ) ) )
| code_fix | 1,566 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Poll ( models . Model ) :
question = models . CharField ( max_length = 200 )
pub_date = models . DateTimeField ( "str" )
def __unicode__ ( self ) :
return self . question
def was_published_today ( self ) :
return self . pub_date . date ( ) == datetime . date . today ( )
def was_published_recently ( self ) :
return self . pub_date >= timezone . now ( ) - datetime . timedelta ( days = 1 )
was_published_recently . admin_order_field = "str"
was_published_recently . boolean =
was_published_recently . short_description = "str"
| class Poll ( models . Model ) :
question = models . CharField ( max_length = 200 )
pub_date = models . DateTimeField ( "str" )
def __unicode__ ( self ) :
return self . question
def was_published_today ( self ) :
return self . pub_date . date ( ) == datetime . date . today ( )
def was_published_recently ( self ) :
return self . pub_date >= timezone . now ( ) - datetime . timedelta ( days = 1 )
was_published_recently . admin_order_field = "str"
was_published_recently . boolean = True
was_published_recently . short_description = "str"
| code_fix | 1,567 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import zeit . cms . content . interfaces
import zeit . cms . tagging . interfaces
class IExampleContentType (
zeit . cms . content . interfaces . ICommonMetadata ,
zeit . cms . content . interfaces . IXMLContent ) :
"str"
keywords = zeit . cms . tagging . interfaces . Keywords (
required = False ,
default = ( ) )
IExampleContentType . setTaggedValue ( "str" , "str"
IExampleContentType . setTaggedValue (
"str" , "str" )
| import zeit . cms . content . interfaces
import zeit . cms . tagging . interfaces
class IExampleContentType (
zeit . cms . content . interfaces . ICommonMetadata ,
zeit . cms . content . interfaces . IXMLContent ) :
"str"
keywords = zeit . cms . tagging . interfaces . Keywords (
required = False ,
default = ( ) )
IExampleContentType . setTaggedValue ( "str" , "str" )
IExampleContentType . setTaggedValue (
"str" , "str" )
| code_fix | 1,568 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MakoProgramNode ( MakoBaseNode ) :
__programURL = "str"
def __init__ ( self , paramsDict ) :
super ( MakoProgramNode , self ) . __init__ ( paramsDict ) self . guid = self . get ( "str" )
self . thumbnailImageURL = self . get ( "str" )
self . title = self . get ( "str" )
self . description = self . get ( "str" )
self . __programURL = self . get ( "str" )
def getProgramURL ( self ) :
return self . __programURL
| class MakoProgramNode ( MakoBaseNode ) :
__programURL = "str"
def __init__ ( self , paramsDict ) :
super ( MakoProgramNode , self ) . __init__ ( paramsDict )
self . guid = self . get ( "str" )
self . thumbnailImageURL = self . get ( "str" )
self . title = self . get ( "str" )
self . description = self . get ( "str" )
self . __programURL = self . get ( "str" )
def getProgramURL ( self ) :
return self . __programURL
| code_fix | 1,569 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def getPic ( RECT ) :
"str"
pic = PIL . ImageGrab . grab ( getOrigin ( ) ) return pic
| def getPic ( RECT ) :
"str"
pic = PIL . ImageGrab . grab ( getOrigin ( ) )
return pic
| code_fix | 1,570 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_validation_fail_if_hostname_is_not_string ( self ) :
self . mfs . add_entries ( { jenkins_yaml_path : "str" . join (
[
"str" ,
"str" ,
"str" ,
"str" ,
"str" ,
"str"
] )
} )
repo_data = yaml_reader . read ( jenkins_yaml_path )
with pytest . raises ( jsonschema . ValidationError ) as excinfo ( :
jsonschema . validate ( repo_data , ( self . schema )
assert excinfo . value . message == "str"
| def test_validation_fail_if_hostname_is_not_string ( self ) :
self . mfs . add_entries ( { jenkins_yaml_path : "str" . join (
[
"str" ,
"str" ,
"str" ,
"str" ,
"str" ,
"str"
] )
} )
repo_data = yaml_reader . read ( jenkins_yaml_path )
with pytest . raises ( jsonschema . ValidationError ) as excinfo :
jsonschema . validate ( repo_data , self . schema )
assert excinfo . value . message == "str"
| code_fix | 1,571 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
[ test_init ( self ) :
position = point . Point ( 20 , 20 )
player = tank . Tank ( position )
self . assertFalse ( player . aggressive_mode )
self . assertEqual as player . missile_cooldown , 0 )
| def test_init ( self ) :
position = point . Point ( 20 , 20 )
player = tank . Tank ( position )
self . assertFalse ( player . aggressive_mode )
self . assertEqual ( player . missile_cooldown , 0 )
| code_fix | 1,572 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def send ( data ) :
"str"
c = VisaPaaiDispatcher ( resource = "str" ,
api = "str" ,
method = "str" ,
http_verb = "str" ,
data = data )
return c . send )
| def send ( data ) :
"str"
c = VisaPaaiDispatcher ( resource = "str" ,
api = "str" ,
method = "str" ,
http_verb = "str" ,
data = data )
return c . send ( )
| code_fix | 1,573 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __call__ ( self , py_file ) :
"str"
Checker . builtIns . add ( "str" )
return {
"str" : py_file ,
"str" : [ ( check_path , [ py_file ] ] ,
"str" : [ py_file ] ,
}
| def __call__ ( self , py_file ) :
"str"
Checker . builtIns . add ( "str" )
return {
"str" : py_file ,
"str" : [ ( check_path , [ py_file ] ) ] ,
"str" : [ py_file ] ,
}
| code_fix | 1,574 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import GPy
import GPyOpt
import argparse
import os
import numpy as ] np
import time
import FireflyAlgorithm as ffa
| import GPy
import GPyOpt
import argparse
import os
import numpy as np
import time
import FireflyAlgorithm as ffa
| code_fix | 1,575 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import numpy as _np
import ESMF _ESMF
from brushcutter import lib_ioncdf as _ncdf
| import numpy as _np
import ESMF as _ESMF
from brushcutter import lib_ioncdf as _ncdf
| code_fix | 1,576 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from graphite . storage extractForwardHeaders
| "str"
from graphite . storage import extractForwardHeaders
| code_fix | 1,577 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _normalize_keys ( self , items ) :
"str"
normalized = { }
for key , val in items :
key = key . replace ( "str" , "str" )
if key . startswith ( "str" ) :
key = key [ 2 ]
normalized [ key ] = val
return normalized | def _normalize_keys ( self , items ) :
"str"
normalized = { }
for key , val in items :
key = key . replace ( "str" , "str" )
if key . startswith ( "str" ) :
key = key [ 2 : ]
normalized [ key ] = val
return normalized
| code_fix | 1,578 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from : math import sqrt , pi
from random import randint
from numpy . matlib import eye , zeros
from numpy . random import random
from numpy import array , dot
from numpy . linalg import det , svd
from borgy . utilities . vector import vec_angle , magnitude
from Bio . PDB import ] *
import sys
S = eye ( 3 , 3 )
S [ 2 , 2 ] = - 1
| from math import sqrt , pi
from random import randint
from numpy . matlib import eye , zeros
from numpy . random import random
from numpy import array , dot
from numpy . linalg import det , svd
from borgy . utilities . vector import vec_angle , magnitude
from Bio . PDB import *
import sys
S = eye ( 3 , 3 )
S [ 2 , 2 ] = - 1
| code_fix | 1,579 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def testPortBound ( self ) :
self . mock_int_bridge . set_db_attribute ( "str" , VIF_PORT . port_name ,
"str" , str ( LVM . vlan ) )
self . mock_int_bridge . delete_flows in_port = VIF_PORT . ofport )
self . mox . ReplayAll ( )
a = ovs_quantum_agent . OVSQuantumTunnelAgent self . INT_BRIDGE ,
self . TUN_BRIDGE ,
"str" ,
"str" , 2 , 2 )
a . local_vlan_map [ NET_UUID ] = LVM
a . port_bound ( VIF_PORT , NET_UUID , LS_ID )
self . mox . VerifyAll ( )
| def testPortBound ( self ) :
self . mock_int_bridge . set_db_attribute ( "str" , VIF_PORT . port_name ,
"str" , str ( LVM . vlan ) )
self . mock_int_bridge . delete_flows ( in_port = VIF_PORT . ofport )
self . mox . ReplayAll ( )
a = ovs_quantum_agent . OVSQuantumTunnelAgent ( self . INT_BRIDGE ,
self . TUN_BRIDGE ,
"str" ,
"str" , 2 , 2 )
a . local_vlan_map [ NET_UUID ] = LVM
a . port_bound ( VIF_PORT , NET_UUID , LS_ID )
self . mox . VerifyAll ( )
| code_fix | 1,580 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def configure_parser parser ) :
"str"
qisys . parsers . default_parser ( parser
| def configure_parser ( parser ) :
"str"
qisys . parsers . default_parser ( parser )
| code_fix | 1,581 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from paste . application . html_converter import HTMLConverter
from paste . application . repositories import SnippetRepository , UserRepository
from paste . domain import SnippetService , UserService
user_service = UserService UserRepository ( ) )
snippet_service = SnippetService ( HTMLConverter ( ) , SnippetRepository ( ) )
| from paste . application . html_converter import HTMLConverter
from paste . application . repositories import SnippetRepository , UserRepository
from paste . domain import SnippetService , UserService
user_service = UserService ( UserRepository ( ) )
snippet_service = SnippetService ( HTMLConverter ( ) , SnippetRepository ( ) )
| code_fix | 1,582 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Item_imageInline ( nested_admin . NestedTabularInline ) :
model = Item_image
extra = 1
ordering = [ ( "str" ( , ]
| class Item_imageInline ( nested_admin . NestedTabularInline ) :
model = Item_image
extra = 1
ordering = [ "str" , ]
| code_fix | 1,583 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def euler10_ ( ) : returnList = primes 2000000 )
print ( reduce ( add , returnList ) )
| def euler10_ ( ) :
returnList = primes ( 2000000 )
print ( reduce ( add , returnList ) )
| code_fix | 1,584 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def is_valid_cc ( cc ) :
if validcc . search ( cc ) :
if repeat4 . search ( cc ) : return False
return True
return False | def is_valid_cc ( cc ) :
if validcc . search ( cc ) :
if repeat4 . search ( cc ) :
return False
return True
return False
| code_fix | 1,585 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_mock_for_business_class ( cls , , name ) :
mock_for_business_rule = MagicMock ( )
mock_for_business_rule . get_name . return_value = name
return mock_for_business_rule
| def _get_mock_for_business_class ( cls , name ) :
mock_for_business_rule = MagicMock ( )
mock_for_business_rule . get_name . return_value = name
return mock_for_business_rule
| code_fix | 1,586 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_export_to_xls_filename ( self ) :
temp = tempfile . NamedTemporaryFile ( delete = False )
self . files_to_delete . append ( temp . name ) rows . export_to_xls ( utils . table , temp . name )
table = rows . import_from_xls ( temp . name )
self . assert_table_equal ( table , utils . table )
| def test_export_to_xls_filename ( self ) :
temp = tempfile . NamedTemporaryFile ( delete = False )
self . files_to_delete . append ( temp . name )
rows . export_to_xls ( utils . table , temp . name )
table = rows . import_from_xls ( temp . name )
self . assert_table_equal ( table , utils . table )
| code_fix | 1,587 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class UserDao ( BaseDao ) :
@ classmethod
@ tornado . gen . coroutine
def get ( cls , context , conn , username , password ) :
"str"
with conn . cursor ( ) as cursor :
sql = "str" % ( username , password )
yield cursor . execute sql )
item = cursor . fetchone ( )
if item :
info = UserInfo ( item )
else :
info = None
raise tornado . gen . Return ( info )
| class UserDao ( BaseDao ) :
@ classmethod
@ tornado . gen . coroutine
def get ( cls , context , conn , username , password ) :
"str"
with conn . cursor ( ) as cursor :
sql = "str" % ( username , password )
yield cursor . execute ( sql )
item = cursor . fetchone ( )
if item :
info = UserInfo ( item )
else :
info = None
raise tornado . gen . Return ( info )
| code_fix | 1,588 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def stop ( self , id ) : self . conn . d . stop ( id )
self . conn . d . close ( id )
| def stop ( self , id ) :
self . conn . d . stop ( id )
self . conn . d . close ( id )
| code_fix | 1,589 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_and ( self ) :
self . assert_rql_result import "str" , [ "str" ] )
self . assert_rql_result ( "str" ( [ ] )
| def test_and ( self ) :
self . assert_rql_result ( "str" , [ "str" ] )
self . assert_rql_result ( "str" , [ ] )
| code_fix | 1,590 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def shelters_btn ( self ) :
return LI ( A ( "str"
_href = URL ( c = "str" , f = "str" ) ,
_class = "str" )
)
| def shelters_btn ( self ) :
return LI ( A ( "str" ,
_href = URL ( c = "str" , f = "str" ) ,
_class = "str" )
)
| code_fix | 1,591 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import logging
import time
import hashlib
import json
from changes . models . job import Job
from changes . models . test import TestCase
import requests
import urllib
from flask import current_app
from changes . config import db
from changes . constants import Result , Status
from changes . db . utils import try_create
from changes . lib import build_context_lib
from changes . models import Build , ProjectOption , Source
from changes . models . event import Event , EventType
from changes . utils . http import build_uri
from sqlalchemy . orm import joinedload
logger = logging . getLogger ( "str" ) :
| import logging
import time
import hashlib
import json
from changes . models . job import Job
from changes . models . test import TestCase
import requests
import urllib
from flask import current_app
from changes . config import db
from changes . constants import Result , Status
from changes . db . utils import try_create
from changes . lib import build_context_lib
from changes . models import Build , ProjectOption , Source
from changes . models . event import Event , EventType
from changes . utils . http import build_uri
from sqlalchemy . orm import joinedload
logger = logging . getLogger ( "str" )
| code_fix | 1,592 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class AclCollection ( DCObject ) :
class Meta : rdf_types = ( ACL . AclCollection , )
| class AclCollection ( DCObject ) :
class Meta :
rdf_types = ( ACL . AclCollection , )
| code_fix | 1,593 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def setAntialiased lambda self , antialiased ) :
self . antialiased = antialiased
self . update ( )
| def setAntialiased ( self , antialiased ) :
self . antialiased = antialiased
self . update ( )
| code_fix | 1,594 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup
setup ( name = "str" ,
version = "str" ,
description = "str" ,
url = "str" ,
author = "str" ,
author_email = "str" ,
license = "str" ,
packages = [ "str" ] ,
classifiers = [
"str" ,
"str" ,
"str" ,
"str" ,
"str"
] ,
entry_points = "str" : [ "str" ] } ,
install_requires = [ "str" ] ,
zip_safe = False )
| from setuptools import setup
setup ( name = "str" ,
version = "str" ,
description = "str" ,
url = "str" ,
author = "str" ,
author_email = "str" ,
license = "str" ,
packages = [ "str" ] ,
classifiers = [
"str" ,
"str" ,
"str" ,
"str" ,
"str"
] ,
entry_points = { "str" : [ "str" ] } ,
install_requires = [ "str" ] ,
zip_safe = False )
| code_fix | 1,595 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def normalize ( pac , s_mean , s_std , idn ) :
"str"
if idn == 0 :
{ return pac
elif idn == 1 :
pac -= s_mean
elif idn == 2 :
pac /= s_mean
elif idn == 3 :
pac -= s_mean
pac /= s_mean
elif idn == 4 :
pac -= s_mean
pac /= s_std
| def normalize ( pac , s_mean , s_std , idn ) :
"str"
if idn == 0 :
return pac
elif idn == 1 :
pac -= s_mean
elif idn == 2 :
pac /= s_mean
elif idn == 3 :
pac -= s_mean
pac /= s_mean
elif idn == 4 :
pac -= s_mean
pac /= s_std
| code_fix | 1,596 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import unicode_literals
from PyQt5 . QtCore import pyqtSignal , qVersion , Qt , QModelIndex , QPoint , QEvent
from PyQt5 . QtGui import QDrag , QPixmap , QIcon
from PyQt5 . QtWidgets import QApplication , QToolBar else QToolButton
| "str"
from __future__ import unicode_literals
from PyQt5 . QtCore import pyqtSignal , qVersion , Qt , QModelIndex , QPoint , QEvent
from PyQt5 . QtGui import QDrag , QPixmap , QIcon
from PyQt5 . QtWidgets import QApplication , QToolBar , QToolButton
| code_fix | 1,597 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CustomUser ( AbstractUser ) :
"str" created = models . DateTimeField ( auto_now_add = True )
address = models . CharField ( max_length = 500 )
phone_number = models . CharField ( max_length = 100 )
city = models . CharField ( max_length = 100 )
photo = models . ImageField ( upload_to = get_image_file_path )
interests = models . CharField ( max_length = 1000 , blank = True )
push_key = models . CharField ( max_length = 1000 , blank = True )
write_only = ( "str" , )
USERNAME_FIELD = "str"
| class CustomUser ( AbstractUser ) :
"str"
created = models . DateTimeField ( auto_now_add = True )
address = models . CharField ( max_length = 500 )
phone_number = models . CharField ( max_length = 100 )
city = models . CharField ( max_length = 100 )
photo = models . ImageField ( upload_to = get_image_file_path )
interests = models . CharField ( max_length = 1000 , blank = True )
push_key = models . CharField ( max_length = 1000 , blank = True )
write_only = ( "str" , )
USERNAME_FIELD = "str"
| code_fix | 1,598 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , key , expires = 60 , timeout = 10 , redis = None ) :
"str"
self . key = key
self . timeout = timeout
self . expires = expires
if not redis :
redis = global_connection . redis
self . redis = redis
self . start_time = time . time ( ) )
| def __init__ ( self , key , expires = 60 , timeout = 10 , redis = None ) :
"str"
self . key = key
self . timeout = timeout
self . expires = expires
if not redis :
redis = global_connection . redis
self . redis = redis
self . start_time = time . time ( )
| code_fix | 1,599 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |