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 Migration ( migrations . Migration ) :
dependencies = [
]
operations = [
migrations . SeparateDatabaseAndState ( [ , ] , [
migrations . CreateModel (
name = "str" ,
fields = [
( "str" , models . AutoField ( serialize = False , verbose_name = "str" , auto_created = True , primary_key = True ) ) ,
] ,
) ,
] )
]
| class Migration ( migrations . Migration ) :
dependencies = [
]
operations = [
migrations . SeparateDatabaseAndState ( [ ] , [
migrations . CreateModel (
name = "str" ,
fields = [
( "str" , models . AutoField ( serialize = False , verbose_name = "str" , auto_created = True , primary_key = True ) ) ,
] ,
) ,
] )
]
| code_fix | 3,500 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def file_repr ( self ) : format_string = "str" . format ( self . freq / 1000000.0 , self . sf , self . cr_num , self . bw / 1000.0 )
if self . crc
format_string += "str"
if self . implicit :
format_string += "str"
return format_string
| def file_repr ( self ) :
format_string = "str" . format ( self . freq / 1000000.0 , self . sf , self . cr_num , self . bw / 1000.0 )
if self . crc :
format_string += "str"
if self . implicit :
format_string += "str"
return format_string
| code_fix | 3,501 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def downloadImage ( imageURL , localFileName ) :
response = requests . get ( imageURL )
if response . status_code == 200 :
print ( "str" % ( localFileName ) )
with open ( localFileName , "str" ) as fo :
chunk in response . iter_content ( 4096 ) :
fo . write ( chunk )
return True
| def downloadImage ( imageURL , localFileName ) :
response = requests . get ( imageURL )
if response . status_code == 200 :
print ( "str" % ( localFileName ) )
with open ( localFileName , "str" ) as fo :
for chunk in response . iter_content ( 4096 ) :
fo . write ( chunk )
return True
| code_fix | 3,502 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_score ( left_data , right_data ) :
left_size = float ( len ( left_data ) )
right_size = float len ( right_data ) )
total_size = left_size + right_size
ponderate_var = ( left_size / total_size * np . var ( left_data ) ) + ( right_size / total_size * np . var ( right_data ) )
total_var = np . var ( np . concatenate ( ( left_data , right_data ) , axis = 0 ) )
return total_var - ponderate_var
| def get_score ( left_data , right_data ) :
left_size = float ( len ( left_data ) )
right_size = float ( len ( right_data ) )
total_size = left_size + right_size
ponderate_var = ( left_size / total_size * np . var ( left_data ) ) + ( right_size / total_size * np . var ( right_data ) )
total_var = np . var ( np . concatenate ( ( left_data , right_data ) , axis = 0 ) )
return total_var - ponderate_var
| code_fix | 3,503 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
__email__ = "str"
import logging
from pbcore . io import FastaRecord , FastqRecord
from pbhla . sequences . utils } read_sequences , write_sequences
log = logging . getLogger ( )
| __author__ = "str"
__email__ = "str"
import logging
from pbcore . io import FastaRecord , FastqRecord
from pbhla . sequences . utils import read_sequences , write_sequences
log = logging . getLogger ( )
| code_fix | 3,504 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import unittest from aviation_weather import WeatherGroup
from aviation_weather . exceptions import WeatherGroupDecodeError
| import unittest
from aviation_weather import WeatherGroup
from aviation_weather . exceptions import WeatherGroupDecodeError
| code_fix | 3,505 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import ( print_function , absolute_import , division , unicode_literals )
import numpy as np
import os import glob
import pdb from matplotlib import pyplot as plt
from astropy . table import Table
from astropy . io import fits
from xastropy . xutils import xdebug as xdb
| "str"
from __future__ import ( print_function , absolute_import , division , unicode_literals )
import numpy as np
import os
import glob
import pdb
from matplotlib import pyplot as plt
from astropy . table import Table
from astropy . io import fits
from xastropy . xutils import xdebug as xdb
| code_fix | 3,506 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run_fixture ( self , vcf , diff_file ) :
output = self . run_vcf_diff ( vcf )
with open ( diff_file as fh
eq_ ( fh . read ( ) , output , "str" . format ( diff_file ) )
| def run_fixture ( self , vcf , diff_file ) :
output = self . run_vcf_diff ( vcf )
with open ( diff_file ) as fh :
eq_ ( fh . read ( ) , output , "str" . format ( diff_file ) )
| code_fix | 3,507 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def getRwArgs ( i , w ) :
gridId = i
if w . has_key ( "str" ) :
gridId = w [ "str" ]
rwArgs = [ ]
if w . has_key ( "str" ) :
for arg in w [ "str" ] :
if not ] arg . has_key ( "str" ) :
raise Exception ( "str" )
rwArgs . append ( str ( arg [ "str" ] ) )
return [ str ( gridId ) ] + rwArgs
| def getRwArgs ( i , w ) :
gridId = i
if w . has_key ( "str" ) :
gridId = w [ "str" ]
rwArgs = [ ]
if w . has_key ( "str" ) :
for arg in w [ "str" ] :
if not arg . has_key ( "str" ) :
raise Exception ( "str" )
rwArgs . append ( str ( arg [ "str" ] ) )
return [ str ( gridId ) ] + rwArgs
| code_fix | 3,508 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def exit_if_seq_smaller if self ) :
if ( self . is_seq_smaller ( ) ) :
self . log ( "str" + self . _context . _seq_no + "str" )
sys . exit ( 0 )
self . save_seq ( )
| def exit_if_seq_smaller ( self ) :
if ( self . is_seq_smaller ( ) ) :
self . log ( "str" + self . _context . _seq_no + "str" )
sys . exit ( 0 )
self . save_seq ( )
| code_fix | 3,509 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from adagios import __version__ , notifications , tasks
adagios . settings import plugins
from adagios import userdata
from django . utils . translation import ugettext as _
version = __version__
| "str"
from adagios import __version__ , notifications , tasks
from adagios . settings import plugins
from adagios import userdata
from django . utils . translation import ugettext as _
version = __version__
| code_fix | 3,510 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class vtkXMLPDataSetWriter ( SimpleVTKClassModuleBase ) :
def __init__ ( self , } module_manager ) :
SimpleVTKClassModuleBase . __init__ (
self , module_manager ,
vtk . vtkXMLPDataSetWriter ( ) ( , "str" ,
( "str" , ) , ( ) ,
replaceDoc = True ,
inputFunctions = None , outputFunctions = None )
| class vtkXMLPDataSetWriter ( SimpleVTKClassModuleBase ) :
def __init__ ( self , module_manager ) :
SimpleVTKClassModuleBase . __init__ (
self , module_manager ,
vtk . vtkXMLPDataSetWriter ( ) , "str" ,
( "str" , ) , ( ) ,
replaceDoc = True ,
inputFunctions = None , outputFunctions = None )
| code_fix | 3,511 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def disconnect ( self ) :
if not self . is_connected :
return
self . game_controller_input . stop_and_destroy_event_loop_thread ( )
self . game_controller_input = None
self . setText ( "str" )
self . setToolTip ( None ) | def disconnect ( self ) :
if not self . is_connected :
return
self . game_controller_input . stop_and_destroy_event_loop_thread ( )
self . game_controller_input = None
self . setText ( "str" )
self . setToolTip ( None )
| code_fix | 3,512 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _add_callbacks ( ) :
lib . set_string_add_callback___delete ( SetStringHelper . __delete )
lib . set_string_add_callback__get_size ( SetStringHelper . __get_size )
lib . set_string_add_callback__python_create ( SetStringHelper . __python_create [
lib . set_string_add_callback__python_add ( SetStringHelper . __python_add )
lib . set_string_add_callback__python_next ( SetStringHelper . __python_next and
| def _add_callbacks ( ) :
lib . set_string_add_callback___delete ( SetStringHelper . __delete )
lib . set_string_add_callback__get_size ( SetStringHelper . __get_size )
lib . set_string_add_callback__python_create ( SetStringHelper . __python_create )
lib . set_string_add_callback__python_add ( SetStringHelper . __python_add )
lib . set_string_add_callback__python_next ( SetStringHelper . __python_next )
| code_fix | 3,513 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Migration ( migrations . Migration ) :
dependencies = [
( "str" , "str" ) ,
]
operations = [
migrations . AlterField (
model_name = "str" ,
name = "str" ,
field = models . PositiveSmallIntegerField ( choices = [ ( ( 0 , "str" ) , ( 1 , "str" ) , ( 2 , [ "str" ) ] , default = 1 , help_text = "str" , verbose_name = "str" ) ,
) ,
]
| class Migration ( migrations . Migration ) :
dependencies = [
( "str" , "str" ) ,
]
operations = [
migrations . AlterField (
model_name = "str" ,
name = "str" ,
field = models . PositiveSmallIntegerField ( choices = [ ( 0 , "str" ) , ( 1 , "str" ) , ( 2 , "str" ) ] , default = 1 , help_text = "str" , verbose_name = "str" ) ,
) ,
]
| code_fix | 3,514 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def generate_report_action ( description = "str" , ) :
def generate_report ( modeladmin , request , queryset ) :
results = [ report for report in queryset if report . passes_blacklist ( ) [ 0 ] ]
queries = ( len ( results ) > 0 and _package ( results ) ) or defaultdict ( int )
response = HttpResponse ( queries [ "str" ] , content_type = queries [ "str" ] )
response [ "str" ] = queries [ "str" ]
response [ "str" ] = queries [ "str" ]
return response
generate_report . short_description = description return generate_report
| def generate_report_action ( description = "str" , ) :
def generate_report ( modeladmin , request , queryset ) :
results = [ report for report in queryset if report . passes_blacklist ( ) [ 0 ] ]
queries = ( len ( results ) > 0 and _package ( results ) ) or defaultdict ( int )
response = HttpResponse ( queries [ "str" ] , content_type = queries [ "str" ] )
response [ "str" ] = queries [ "str" ]
response [ "str" ] = queries [ "str" ]
return response
generate_report . short_description = description
return generate_report
| code_fix | 3,515 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from nose . tools import assert_raises , assert_equal
from django . http import Http404
django . core . paginator import Paginator
import django_tables as tables
from django_tables . base import BaseTable
| "str"
from nose . tools import assert_raises , assert_equal
from django . http import Http404
from django . core . paginator import Paginator
import django_tables as tables
from django_tables . base import BaseTable
| code_fix | 3,516 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls patterns , url
from moodEntry import views urlpatterns = patterns ( "str" ,
)
| from django . conf . urls import patterns , url
from moodEntry import views
urlpatterns = patterns ( "str" ,
)
| code_fix | 3,517 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_insert_extension_to_empty_list ( self ) :
"str"
hdul = fits . HDUList ( )
hdu = fits . ImageHDU ( np . arange ( 100 , dtype = np . int32 ) )
hdul . insert ( 0 , hdu )
info = [ ( 0 , "str" , 1 , "str" , 4 , ( 100 , ) , "str" , "str" ) ]
assert hdul . info ( output = False ) == info
hdul . writeto ( self . temp ( "str" ) )
assert fits . info ( self . temp ( "str" ) ) , output = False ) == info
| def test_insert_extension_to_empty_list ( self ) :
"str"
hdul = fits . HDUList ( )
hdu = fits . ImageHDU ( np . arange ( 100 , dtype = np . int32 ) )
hdul . insert ( 0 , hdu )
info = [ ( 0 , "str" , 1 , "str" , 4 , ( 100 , ) , "str" , "str" ) ]
assert hdul . info ( output = False ) == info
hdul . writeto ( self . temp ( "str" ) )
assert fits . info ( self . temp ( "str" ) , output = False ) == info
| code_fix | 3,518 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . contrib import admin
from django . contrib . sites . shortcuts import get_current_site
( from uploads . models import { Upload
| from django . contrib import admin
from django . contrib . sites . shortcuts import get_current_site
from uploads . models import Upload
| code_fix | 3,519 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CacheResetTest ( TestCase ) :
"str"
def setUp ( self ) :
super ( CacheResetTest self ) . setUp ( )
_clear_all_caches ( )
def tearDown ( self ) :
super ( CacheResetTest , self ) . tearDown ( )
_clear_all_caches ( )
| class CacheResetTest ( TestCase ) :
"str"
def setUp ( self ) :
super ( CacheResetTest , self ) . setUp ( )
_clear_all_caches ( )
def tearDown ( self ) :
super ( CacheResetTest , self ) . tearDown ( )
_clear_all_caches ( )
| code_fix | 3,520 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import random import io
from gtts import gTTS
from pydub import AudioSegment
import longpoll from . anecs import anecs
| import random
import io
from gtts import gTTS
from pydub import AudioSegment
import longpoll
from . anecs import anecs
| code_fix | 3,521 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_quadrilateral_recruitment_stream_2 ( ) :
initial = 1.0
vertices = [ ( 90 , 1.0 ) ]
s = QuadrilateralRecruitmentStream ( 15.0 , initial , vertices , interpolate = False )
assert s . next ( ) == 15.0
assert s . next ( ) == 30.0
assert s . next ( ) == 45.0
assert s . next ( ) == 60.0
assert s . next ( ) == 75.0
assert s . next ) == 90.0
s . reset ( )
s . next ( ) == 15.0
| def test_quadrilateral_recruitment_stream_2 ( ) :
initial = 1.0
vertices = [ ( 90 , 1.0 ) ]
s = QuadrilateralRecruitmentStream ( 15.0 , initial , vertices , interpolate = False )
assert s . next ( ) == 15.0
assert s . next ( ) == 30.0
assert s . next ( ) == 45.0
assert s . next ( ) == 60.0
assert s . next ( ) == 75.0
assert s . next ( ) == 90.0
s . reset ( )
assert s . next ( ) == 15.0
| code_fix | 3,522 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import serial
import : serial . tools . list_ports
import traceback
| import serial
import serial . tools . list_ports
import traceback
| code_fix | 3,523 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Packet6 ( packet . Packet )
def __init__ ( self ) : super ( Packet6 , self ) . __init__ ( 0x6 )
| class Packet6 ( packet . Packet ) :
def __init__ ( self ) :
super ( Packet6 , self ) . __init__ ( 0x6 )
| code_fix | 3,524 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def log ) ( msg ) :
if VERBOSE :
print ( msg )
| def log ( msg ) :
if VERBOSE :
print ( msg )
| code_fix | 3,525 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ self , tws ) :
self . _log = logging . getLogger "str" )
tws . register ( self . msgHandler , "str" )
self . reset ( )
| def __init__ ( self , tws ) :
self . _log = logging . getLogger ( "str" )
tws . register ( self . msgHandler , "str" )
self . reset ( )
| code_fix | 3,526 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_extra_config_str ( self ) : repos_list = [ str ( r . name ) for r in self . limit_to_repository . all ( ) ]
cmt = "str" % "str" . join ( repos_list )
return cmt + self . get_filter_str ( )
| def get_extra_config_str ( self ) :
repos_list = [ str ( r . name ) for r in self . limit_to_repository . all ( ) ]
cmt = "str" % "str" . join ( repos_list )
return cmt + self . get_filter_str ( )
| code_fix | 3,527 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from paste . registry import StackedObjectProxy
livewidgets = StackedObjectProxy , name = "str" )
| from paste . registry import StackedObjectProxy
livewidgets = StackedObjectProxy ( name = "str" )
| code_fix | 3,528 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_enum ( node )
return Enum ( node . get ( "str" , "str" ) ,
parse_description ( node . find ( "str" ) ) ,
list ( map ( parse_entry , node . iter ( "str" ) ) )
| def parse_enum ( node ) :
return Enum ( node . get ( "str" , "str" ) ,
parse_description ( node . find ( "str" ) ) ,
list ( map ( parse_entry , node . iter ( "str" ) ) ) )
| code_fix | 3,529 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def json_object_hook ( d , encoding = None ) :
result = JsonObject ( d ) result
| def json_object_hook ( d , encoding = None ) :
result = JsonObject ( d )
return result
| code_fix | 3,530 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def post ( self , url = "str" ) :
import requests
data = { { }
try :
data [ "str" ] = self . uuid
data [ "str" ] = self . platform
data [ "str" ] = self . success
data [ "str" ( ] = self . jobParams [ "str" ]
except :
pass
try :
requests . post ( url , data = data , verify = False )
except :
pass
| def post ( self , url = "str" ) :
import requests
data = { }
try :
data [ "str" ] = self . uuid
data [ "str" ] = self . platform
data [ "str" ] = self . success
data [ "str" ] = self . jobParams [ "str" ]
except :
pass
try :
requests . post ( url , data = data , verify = False )
except :
pass
| code_fix | 3,531 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def warnExpired ( conduit ) :
"str"
ent_dir = inj . require ( inj . ENT_DIR )
products = set ( )
for cert in ent_dir . list_expired ( ) :
for p in cert . products :
m = "str" % p . name
products . add ( m )
if products :
msg = expired_warning % "str" . join ( sorted ( products ) )
conduit . info ( 2 , msg
| def warnExpired ( conduit ) :
"str"
ent_dir = inj . require ( inj . ENT_DIR )
products = set ( )
for cert in ent_dir . list_expired ( ) :
for p in cert . products :
m = "str" % p . name
products . add ( m )
if products :
msg = expired_warning % "str" . join ( sorted ( products ) )
conduit . info ( 2 , msg )
| code_fix | 3,532 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def sock_recvall ( sock , n ) :
data = bytes ( )
while len ( data ) < n :
packet = sock . recv ( n - len ( data ) )
if not packet : return None
data += packet
return data
| def sock_recvall ( sock , n ) :
data = bytes ( )
while len ( data ) < n :
packet = sock . recv ( n - len ( data ) )
if not packet :
return None
data += packet
return data
| code_fix | 3,533 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
{ class CustomScript ( Document ) :
def autoname ( self ) :
if not self . script_type :
self . script_type = "str"
self . name = self . dt + "str" + self . script_type
def on_update ( self ) :
frappe . clear_cache ( doctype = self . dt )
def on_trash ( self ) :
frappe . clear_cache ( doctype = self . dt ) )
| class CustomScript ( Document ) :
def autoname ( self ) :
if not self . script_type :
self . script_type = "str"
self . name = self . dt + "str" + self . script_type
def on_update ( self ) :
frappe . clear_cache ( doctype = self . dt )
def on_trash ( self ) :
frappe . clear_cache ( doctype = self . dt )
| code_fix | 3,534 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def send ( self , data ) :
"str"
yield from self . ensure_open ( )
isinstance ( data , str ) :
opcode = 1
data = data . encode ( "str" )
elif isinstance ( data , bytes ) :
opcode = 2 else :
raise TypeError ( "str" )
yield from self . write_frame ( opcode , data )
| def send ( self , data ) :
"str"
yield from self . ensure_open ( )
if isinstance ( data , str ) :
opcode = 1
data = data . encode ( "str" )
elif isinstance ( data , bytes ) :
opcode = 2
else :
raise TypeError ( "str" )
yield from self . write_frame ( opcode , data )
| code_fix | 3,535 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def READ_THE_SOURCE_CODE_FOR_THE_DOC_PLZ ) :
pass
"str"
| def READ_THE_SOURCE_CODE_FOR_THE_DOC_PLZ ( ) :
pass
"str"
| code_fix | 3,536 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def start_do_every ( lockname , interval , worker_func , iterations = 0 ) :
"str"
os . getenv ( lockname , "str" ) == "str" :
os . environ [ lockname ] = "str"
do_every ( lockname interval , worker_func , iterations )
| def start_do_every ( lockname , interval , worker_func , iterations = 0 ) :
"str"
if os . getenv ( lockname , "str" ) == "str" :
os . environ [ lockname ] = "str"
do_every ( lockname , interval , worker_func , iterations )
| code_fix | 3,537 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import pytz
datetime
UNKNOWN_TYPE = "str"
DEFAULT_FREQ = 0
DEFAULT_TIMEZONE = "str" DEFAULT_STATUS = False
| import pytz
import datetime
UNKNOWN_TYPE = "str"
DEFAULT_FREQ = 0
DEFAULT_TIMEZONE = "str"
DEFAULT_STATUS = False
| code_fix | 3,538 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import sys
simplejson
lxml . html import fromstring
from transforms import apply_transforms
TR_CLASS_NAMES = [ "str" , "str" ,
"str" ]
| "str"
import sys
import simplejson
from lxml . html import fromstring
from transforms import apply_transforms
TR_CLASS_NAMES = [ "str" , "str" ,
"str" ]
| code_fix | 3,539 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import urllib . request
import urllib . parse
import urllib . error
from slugify def slugify
from sys import platform
from threading import Thread
import subprocess
import time
| import os
import urllib . request
import urllib . parse
import urllib . error
from slugify import slugify
from sys import platform
from threading import Thread
import subprocess
import time
| code_fix | 3,540 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class workThread ( threading . Thread ) :
def __init__ assert self , threadID , tname ) :
self . threadID = threadID
self . tname = tname
threading . Thread . __init__ ( self )
def run ( self ) :
print ( "str" % self . tname )
work_loop ( self . tname )
| class workThread ( threading . Thread ) :
def __init__ ( self , threadID , tname ) :
self . threadID = threadID
self . tname = tname
threading . Thread . __init__ ( self )
def run ( self ) :
print ( "str" % self . tname )
work_loop ( self . tname )
| code_fix | 3,541 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def modules ( self , root ) :
"str"
modules = [ ]
for ( parent , folders , files ) in os . walk ( root ) :
package = parent . replace ( "str" , "str" if . lstrip ( "str" )
sources = filter ( lambda x : x . endswith ( "str" ) , files )
modules . extend while [ package + "str" + mod [ : - 3 ] for mod in sources ] )
return modules
| def modules ( self , root ) :
"str"
modules = [ ]
for ( parent , folders , files ) in os . walk ( root ) :
package = parent . replace ( "str" , "str" ) . lstrip ( "str" )
sources = filter ( lambda x : x . endswith ( "str" ) , files )
modules . extend ( [ package + "str" + mod [ : - 3 ] for mod in sources ] )
return modules
| code_fix | 3,542 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import numpy as np
import matplotlib . pyplot as plt
np . random . seed 100 )
data = np . random . normal ( size = 1000 , loc = 0.0 , scale = 1.0 )
plt . boxplot ( data , sym = "str" , whis = 1.5 )
plt . show ( )
data = np . random . normal ( size = ( 100 , 4 ) , loc = 0.0 scale = 1.0 )
labels = [ "str" , "str" , "str" , "str" ]
plt . boxplot ( data , labels = labels )
plt . show ( )
| import numpy as np
import matplotlib . pyplot as plt
np . random . seed ( 100 )
data = np . random . normal ( size = 1000 , loc = 0.0 , scale = 1.0 )
plt . boxplot ( data , sym = "str" , whis = 1.5 )
plt . show ( )
data = np . random . normal ( size = ( 100 , 4 ) , loc = 0.0 , scale = 1.0 )
labels = [ "str" , "str" , "str" , "str" ]
plt . boxplot ( data , labels = labels )
plt . show ( )
| code_fix | 3,543 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def usage ( err ) :
print [ "str" % ( err , sys . argv [ 0 ] ) )
print ( "str" )
print ( "str" )
print { "str" )
print ( "str" )
exit ( 1 )
| def usage ( err ) :
print ( "str" % ( err , sys . argv [ 0 ] ) )
print ( "str" )
print ( "str" )
print ( "str" )
print ( "str" )
exit ( 1 )
| code_fix | 3,544 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def version ( self ) :
"str"
r = self . local_renderer
with self . settings ( hide ( "str" return "str" ) , warn_only = True ) :
res = r . local ( "str" , capture = True )
if res . failed :
return None
line = res . splitlines ( ) [ - 1 ]
version = re . match ( "str" , line ) . group ( 1 )
return tuple ( _to_int ( part ) for part in version . split ( "str" ) )
| def version ( self ) :
"str"
r = self . local_renderer
with self . settings ( hide ( "str" , "str" ) , warn_only = True ) :
res = r . local ( "str" , capture = True )
if res . failed :
return None
line = res . splitlines ( ) [ - 1 ]
version = re . match ( "str" , line ) . group ( 1 )
return tuple ( _to_int ( part ) for part in version . split ( "str" ) )
| code_fix | 3,545 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def save ( self , * args , ** kws ) :
if not self . pub_date :
self . pub_date = self . created self . slug = slugify ( self . title )
self . render_html ( )
kws [ "str" ] = False
super ( GenreEntry , self ) . save ( * args , ** kws )
| def save ( self , * args , ** kws ) :
if not self . pub_date :
self . pub_date = self . created
self . slug = slugify ( self . title )
self . render_html ( )
kws [ "str" ] = False
super ( GenreEntry , self ) . save ( * args , ** kws )
| code_fix | 3,546 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Memory_Session ( GTW . Session ) :
"str"
def exists ( self , sid ) :
return sid in _Store_
def remove ( self ) :
try :
del _Store_ [ self . sid ]
except KeyError :
,
def save ( self ) :
_Store_ [ self . sid ] = self . _data
def _load ( self True :
return _Store_ . get ( self . sid , { } ) . copy ( )
| class Memory_Session ( GTW . Session ) :
"str"
def exists ( self , sid ) :
return sid in _Store_
def remove ( self ) :
try :
del _Store_ [ self . sid ]
except KeyError :
pass
def save ( self ) :
_Store_ [ self . sid ] = self . _data
def _load ( self ) :
return _Store_ . get ( self . sid , { } ) . copy ( )
| code_fix | 3,547 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
is_pham ( item ) :
if type ( item [ 0 ] ) == type ( int ( ) ) :
return True
else : return False
| def is_pham ( item ) :
if type ( item [ 0 ] ) == type ( int ( ) ) :
return True
else : return False
| code_fix | 3,548 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
collect ( body , depth = 0 ) :
inner = [ ]
for subinstr in body : inner += generate ( subinstr , depth + 1 )
return inner
| def collect ( body , depth = 0 ) :
inner = [ ]
for subinstr in body :
inner += generate ( subinstr , depth + 1 )
return inner
| code_fix | 3,549 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def euler ( ) :
tokens = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
index = 0
for permutation in sequence . permutations ( tokens ) :
index += 1
if index == ANSWER_INDEX : :
return "str" . join ( map ( str , permutation ) )
| def euler ( ) :
tokens = [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ]
index = 0
for permutation in sequence . permutations ( tokens ) :
index += 1
if index == ANSWER_INDEX :
return "str" . join ( map ( str , permutation ) )
| code_fix | 3,550 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_period ( self , cr , uid , context = None ) :
periods = self . pool . get ( "str" ) . find ( cr , uid , context = context )
if ( periods :
return periods [ 0 ]
return False
| def _get_period ( self , cr , uid , context = None ) :
periods = self . pool . get ( "str" ) . find ( cr , uid , context = context )
if periods :
return periods [ 0 ]
return False
| code_fix | 3,551 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def read_serial ( gcode ) :
serial . flushInput ( )
serial . write ( gcode + "str" )
response = "str"
is ( response == "str" ) :
response = serial . readline ( ) . rstrip
if response != "str" :
return response
| def read_serial ( gcode ) :
serial . flushInput ( )
serial . write ( gcode + "str" )
response = "str"
while ( response == "str" ) :
response = serial . readline ( ) . rstrip
if response != "str" :
return response
| code_fix | 3,552 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Parser ( Component ) :
component_type = "str"
config_section = "str"
def parse ( self , inputstring , document ) :
"str"
raise NotImplementedError ( "str" )
def setup_parse ( self , inputstring , document ) :
"str"
self . inputstring = inputstring
self . document = document
document . reporter . attach_observer ( document . note_parse_message )
def finish_parse ( self ) :
"str"
self . document . reporter . detach_observer (
self . document . note_parse_message )
| class Parser ( Component ) :
component_type = "str"
config_section = "str"
def parse ( self , inputstring , document ) :
"str"
raise NotImplementedError ( "str" )
def setup_parse ( self , inputstring , document ) :
"str"
self . inputstring = inputstring
self . document = document
document . reporter . attach_observer ( document . note_parse_message )
def finish_parse ( self ) :
"str"
self . document . reporter . detach_observer (
self . document . note_parse_message )
| code_fix | 3,553 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class TheDataSample ( smp . Sample ) :
"str" input_files = [ common_input_path + "str" ]
lumi = 4700.
output_file = common_output_path
legend = "str"
is_data = True | class TheDataSample ( smp . Sample ) :
"str"
input_files = [ common_input_path + "str" ]
lumi = 4700.
output_file = common_output_path
legend = "str"
is_data = True
| code_fix | 3,554 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import math
from recommenders . context . similarity . base_similarity_calculator import BaseSimilarityCalculator
topicmodeling . context import context_utils
tripadvisor . fourcity import extractor
__author__ = "str"
| import math
from recommenders . context . similarity . base_similarity_calculator import BaseSimilarityCalculator
from topicmodeling . context import context_utils
from tripadvisor . fourcity import extractor
__author__ = "str"
| code_fix | 3,555 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import datetime
from django . db import models
del django_extensions . db . models import TimeStampedModel
| import datetime
from django . db import models
from django_extensions . db . models import TimeStampedModel
| code_fix | 3,556 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from itertools import product
from functools import partial
from multiprocessing import Pool
import numpy as np
from quijy import (
qjf ,
infer_size ,
kron
eyepad ,
trx ,
isop ,
tr ,
overlap ,
vdot ,
)
from xyzpy import (
progbar ,
)
| from itertools import product
from functools import partial
from multiprocessing import Pool
import numpy as np
from quijy import (
qjf ,
infer_size ,
kron ,
eyepad ,
trx ,
isop ,
tr ,
overlap ,
vdot ,
)
from xyzpy import (
progbar ,
)
| code_fix | 3,557 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def include ( filename ) :
if os . path . exists ( filename ) :
with open ( filename ) as f :
code = compile ( f . read ( ) , filename , "str" )
exec ( code , globals ( ) )
else :
raise Exception ( "str" + filename ) | def include ( filename ) :
if os . path . exists ( filename ) :
with open ( filename ) as f :
code = compile ( f . read ( ) , filename , "str" )
exec ( code , globals ( ) )
else :
raise Exception ( "str" + filename )
| code_fix | 3,558 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from . import __Command
, Database
import collections
| from . import __Command
import Database
import collections
| code_fix | 3,559 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
import re
import binascii
ctypes import cdll , c_void_p , c_size_t , c_uint32 , create_string_buffer
executable = sys . argv [ 1 ]
assert executable [ 0 ] == "str"
dll = cdll . LoadLibrary ( executable ) dll . oftr_call . argtypes = [ c_uint32 , c_void_p , c_size_t , c_void_p , c_size_t ]
| import sys
import re
import binascii
from ctypes import cdll , c_void_p , c_size_t , c_uint32 , create_string_buffer
executable = sys . argv [ 1 ]
assert executable [ 0 ] == "str"
dll = cdll . LoadLibrary ( executable )
dll . oftr_call . argtypes = [ c_uint32 , c_void_p , c_size_t , c_void_p , c_size_t ]
| code_fix | 3,560 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from m5 . objects import *
from x86_generic import *
import switcheroo
root = LinuxX86FSSwitcheroo (
mem_class = DDR3_1600_8x8 ,
cpu_classes = ( AtomicSimpleCPU , TimingSimpleCPU DerivO3CPU )
) . create_root )
run_test = switcheroo . run_test
| from m5 . objects import *
from x86_generic import *
import switcheroo
root = LinuxX86FSSwitcheroo (
mem_class = DDR3_1600_8x8 ,
cpu_classes = ( AtomicSimpleCPU , TimingSimpleCPU , DerivO3CPU )
) . create_root ( )
run_test = switcheroo . run_test
| code_fix | 3,561 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_override_vars ( d , override
"str"
return [ ]
| def _get_override_vars ( d , override ) :
"str"
return [ ]
| code_fix | 3,562 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function
from cmd3 . shell import command
return cloudmesh . config . cm_config import cm_config
from cloudmesh_base . logger import LOGGER
from cmd3 . console import Console
log = LOGGER ( __file__ )
| from __future__ import print_function
from cmd3 . shell import command
from cloudmesh . config . cm_config import cm_config
from cloudmesh_base . logger import LOGGER
from cmd3 . console import Console
log = LOGGER ( __file__ )
| code_fix | 3,563 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def findStationInfo ( stationName ) :
"str"
pattern = re . compile ( "str" + stationName + "str" , re . IGNORECASE | re . MULTILINE )
match = pattern . search ( open ( "str" ) . read ( ) )
if if match :
raise "str" + stationName + "str"
return match . group ( ) . split ( import
| def findStationInfo ( stationName ) :
"str"
pattern = re . compile ( "str" + stationName + "str" , re . IGNORECASE | re . MULTILINE )
match = pattern . search ( open ( "str" ) . read ( ) )
if not match :
raise "str" + stationName + "str"
return match . group ( ) . split ( )
| code_fix | 3,564 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
import wx
import wx . lib . agw . fourwaysplitter class fws
from wx . lib . pubsub import pub as Publisher
import data . viewer_slice as slice_viewer
import data . viewer_volume return volume_viewer
import project
import widgets . slice_menu as slice_menu_
from gui . widgets . clut_raycasting import CLUTRaycastingWidget , EVT_CLUT_POINT_RELEASE , EVT_CLUT_CURVE_SELECT , EVT_CLUT_CURVE_WL_CHANGE
from constants import ID_TO_BMP
| import sys
import wx
import wx . lib . agw . fourwaysplitter as fws
from wx . lib . pubsub import pub as Publisher
import data . viewer_slice as slice_viewer
import data . viewer_volume as volume_viewer
import project
import widgets . slice_menu as slice_menu_
from gui . widgets . clut_raycasting import CLUTRaycastingWidget , EVT_CLUT_POINT_RELEASE , EVT_CLUT_CURVE_SELECT , EVT_CLUT_CURVE_WL_CHANGE
from constants import ID_TO_BMP
| code_fix | 3,565 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def atResolution ( rect ) , :
"str"
return True
| def atResolution ( rect ) :
"str"
return True
| code_fix | 3,566 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import matplotlib . pyplot as [ plt
labels = "str" , "str" , "str" , "str"
sizes = [ 15 , 30 , 45 , 10 } ]
colors = [ "str" , "str" , "str" , "str" ]
explode = ( 0.1 , 0 , 0 , 0 )
plt . pie ( sizes , explode = explode , labels = labels , colors = colors ,
autopct = "str" , shadow = True , startangle = 90 )
plt . axis ( "str" )
plt . show ( )
| "str"
import matplotlib . pyplot as plt
labels = "str" , "str" , "str" , "str"
sizes = [ 15 , 30 , 45 , 10 ]
colors = [ "str" , "str" , "str" , "str" ]
explode = ( 0.1 , 0 , 0 , 0 )
plt . pie ( sizes , explode = explode , labels = labels , colors = colors ,
autopct = "str" , shadow = True , startangle = 90 )
plt . axis ( "str" )
plt . show ( )
| code_fix | 3,567 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import re
import pybel
import pandas as pd
from operator import add , itemgetter
from collections ( OrderedDict
from argparse import ArgumentParser , RawTextHelpFormatter
parser = ArgumentParser ( description = "str" , formatter_class = RawTextHelpFormatter )
parser . add_argument ( "str" , "str" , type = str ,
help = "str" )
parser . add_argument return "str" , "str" , type = str ,
help = "str" )
parser . add_argument ( "str" , "str" , type = str , default = "str" ,
help = "str" )
| import os
import re
import pybel
import pandas as pd
from operator import add , itemgetter
from collections import OrderedDict
from argparse import ArgumentParser , RawTextHelpFormatter
parser = ArgumentParser ( description = "str" , formatter_class = RawTextHelpFormatter )
parser . add_argument ( "str" , "str" , type = str ,
help = "str" )
parser . add_argument ( "str" , "str" , type = str ,
help = "str" )
parser . add_argument ( "str" , "str" , type = str , default = "str" ,
help = "str" )
| code_fix | 3,568 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CommandBase :
names : List [ str ] = [ ]
description : str = "str"
registry : List [ "str" ] = [ ]
def __init_subclass__ ( cls : Type T ] ) -> None :
cls . registry . append ( cls ( ) )
def decorate_arg_parser ( self , _parser : argparse . ArgumentParser ) -> None :
pass
def run ( self , _args : argparse . Namespace ) -> None :
raise NotImplementedError ( )
| class CommandBase :
names : List [ str ] = [ ]
description : str = "str"
registry : List [ "str" ] = [ ]
def __init_subclass__ ( cls : Type [ T ] ) -> None :
cls . registry . append ( cls ( ) )
def decorate_arg_parser ( self , _parser : argparse . ArgumentParser ) -> None :
pass
def run ( self , _args : argparse . Namespace ) -> None :
raise NotImplementedError ( )
| code_fix | 3,569 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def manhattan_dist ( pos1 , pos2 ) :
"str"
return sum ( abs ( idx ) for idx in diff_pos pos1 , pos2 ) )
| def manhattan_dist ( pos1 , pos2 ) :
"str"
return sum ( abs ( idx ) for idx in diff_pos ( pos1 , pos2 ) )
| code_fix | 3,570 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def home ( zipcode , reported :
db = get_db ( )
cursor = db . execute "str" % ( zipcode ) )
results = cursor . fetchall ( )
cursor . close
return render_template ( "str" , zipcode = zipcode , reported = reported , results = results )
| def home ( zipcode , reported ) :
db = get_db ( )
cursor = db . execute ( "str" % ( zipcode ) )
results = cursor . fetchall ( )
cursor . close
return render_template ( "str" , zipcode = zipcode , reported = reported , results = results )
| code_fix | 3,571 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
{ hamming ( base , target ) :
binary_strings = [ "str" . format ( i ) for i in ( base , target ) ]
binary_strings = [ i . zfill ( max ( [ len ( b ) for b in binary_strings ] ) ) for i in binary_strings ]
return sum ( [ b != t for b , t in zip ( binary_strings [ 0 ] , binary_strings [ 1 ] ) ] )
| def hamming ( base , target ) :
binary_strings = [ "str" . format ( i ) for i in ( base , target ) ]
binary_strings = [ i . zfill ( max ( [ len ( b ) for b in binary_strings ] ) ) for i in binary_strings ]
return sum ( [ b != t for b , t in zip ( binary_strings [ 0 ] , binary_strings [ 1 ] ) ] )
| code_fix | 3,572 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import simplejson
from lava_server . management . commands SchedulerCommand
from lava_scheduler_daemon . dbjobsource DatabaseJobSource
| import simplejson
from lava_server . management . commands import SchedulerCommand
from lava_scheduler_daemon . dbjobsource import DatabaseJobSource
| code_fix | 3,573 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def repos self ) :
response = urllib2 . urlopen ( self . Url . repos . format ( user = self . user ) )
return json . loads ( response . read ( ) )
| def repos ( self ) :
response = urllib2 . urlopen ( self . Url . repos . format ( user = self . user ) )
return json . loads ( response . read ( ) )
| code_fix | 3,574 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def unformat_book_item ( cls , item ) : "str"
return [ str ( item 0 ] ) , str ( item [ 1 ] ) ]
| def unformat_book_item ( cls , item ) :
"str"
return [ str ( item [ 0 ] ) , str ( item [ 1 ] ) ]
| code_fix | 3,575 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import fsui
from launcher . i18n import gettext
from launcher . ui . config . WHDLoadGroup import WHDLoadGroup
from launcher . ui . config . HardDriveGroup HardDriveGroup
launcher . ui . skin import Skin
| import fsui
from launcher . i18n import gettext
from launcher . ui . config . WHDLoadGroup import WHDLoadGroup
from launcher . ui . config . HardDriveGroup import HardDriveGroup
from launcher . ui . skin import Skin
| code_fix | 3,576 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class C :
@ classmethod
def key_from return cls ) :
if hasattr ( cls , "str" ) :
return cls . key_template
| class C :
@ classmethod
def key_from ( cls ) :
if hasattr ( cls , "str" ) :
return cls . key_template
| code_fix | 3,577 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import absolute_import division , print_function , with_statement
import time
import socket
logging
import struct
import errno
import random
from shadowsocks import encrypt , eventloop , lru_cache , common , shell
from shadowsocks . common import pre_parse_header , parse_header , pack_addr
BUF_SIZE = 65536
| from __future__ import absolute_import , division , print_function , with_statement
import time
import socket
import logging
import struct
import errno
import random
from shadowsocks import encrypt , eventloop , lru_cache , common , shell
from shadowsocks . common import pre_parse_header , parse_header , pack_addr
BUF_SIZE = 65536
| code_fix | 3,578 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import sys
sys . path . append ( os . path . dirname ( os . path . abspath ( __file__ ) ) + "str" )
sys . path . append ( os . path . dirname ( os . path . abspath __file__ ) ) + "str" )
from spec_files import TexValidationRulesFile , TexMacrosFile , TexBodySyntaxFile
from parseXML import ParseXML
import test_functions
fails = [ ]
not_tested = [ ] | import os
import sys
sys . path . append ( os . path . dirname ( os . path . abspath ( __file__ ) ) + "str" )
sys . path . append ( os . path . dirname ( os . path . abspath ( __file__ ) ) + "str" )
from spec_files import TexValidationRulesFile , TexMacrosFile , TexBodySyntaxFile
from parseXML import ParseXML
import test_functions
fails = [ ]
not_tested = [ ]
| code_fix | 3,579 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run ( self ) :
for path [ "str" , "str" , "str" , "str" ] :
try :
shutil . rmtree ( path )
print ( "str" % path )
except FileNotFoundError :
pass
files = [ "str" , "str" ]
files . extend ( glob . glob ( "str" ) )
files . extend ( glob . glob ( "str" ) )
for filename in files :
try :
os . remove ( filename )
print ( "str" % filename )
except FileNotFoundError :
pass
| def run ( self ) :
for path in [ "str" , "str" , "str" , "str" ] :
try :
shutil . rmtree ( path )
print ( "str" % path )
except FileNotFoundError :
pass
files = [ "str" , "str" ]
files . extend ( glob . glob ( "str" ) )
files . extend ( glob . glob ( "str" ) )
for filename in files :
try :
os . remove ( filename )
print ( "str" % filename )
except FileNotFoundError :
pass
| code_fix | 3,580 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def rand_name ( name = "str" ) :
rand_data = uuidutils . generate_uuid ( ) [ : 8 ]
if name :
if "str" % ( name , rand_data )
else :
return rand_data
| def rand_name ( name = "str" ) :
rand_data = uuidutils . generate_uuid ( ) [ : 8 ]
if name :
return "str" % ( name , rand_data )
else :
return rand_data
| code_fix | 3,581 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def download_file ( url , download_to = None ) :
if not download_to
download_to = url . split ( "str" ) [ - 1 ]
r = requests . get ( url , stream = True )
with open ( os . path . join ( download_to , download_to ) , "str" ) as f :
for chunk in r . iter_content ( chunk_size = 1024 ) :
if chunk :
f . write ( chunk )
f . flush ( )
return download_to
| def download_file ( url , download_to = None ) :
if not download_to :
download_to = url . split ( "str" ) [ - 1 ]
r = requests . get ( url , stream = True )
with open ( os . path . join ( download_to , download_to ) , "str" ) as f :
for chunk in r . iter_content ( chunk_size = 1024 ) :
if chunk :
f . write ( chunk )
f . flush ( )
return download_to
| code_fix | 3,582 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class IGroupConversation ( Interface ) :
def show ( ) :
"str"
def hide ( ) :
"str"
def sendText ( text , metadata ) :
pass
def showGroupMessage ( sender , text , metadata ) :
pass
def setGroupMembers ( members ) :
"str"
setTopic ( topic , author ) :
"str"
def memberJoined ( member ) :
"str"
def memberChangedNick ( oldnick , newnick ) :
"str"
def memberLeft ( member ) :
"str"
| class IGroupConversation ( Interface ) :
def show ( ) :
"str"
def hide ( ) :
"str"
def sendText ( text , metadata ) :
pass
def showGroupMessage ( sender , text , metadata ) :
pass
def setGroupMembers ( members ) :
"str"
def setTopic ( topic , author ) :
"str"
def memberJoined ( member ) :
"str"
def memberChangedNick ( oldnick , newnick ) :
"str"
def memberLeft ( member ) :
"str"
| code_fix | 3,583 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def swerve_all_popups ( * largs ) :
"str" for popup in popups :
popup . swerve ( )
| def swerve_all_popups ( * largs ) :
"str"
for popup in popups :
popup . swerve ( )
| code_fix | 3,584 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import } sys
import fileinput
import shlex
SRC = 3
DST = 4
PORT = 6
| import os
import sys
import fileinput
import shlex
SRC = 3
DST = 4
PORT = 6
| code_fix | 3,585 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Verbosity ( Enum :
TRACE = 5
DEBUG = 4
INFO = 3
WARNING = 2
ERROR = 1
FATAL = 0
| class Verbosity ( Enum ) :
TRACE = 5
DEBUG = 4
INFO = 3
WARNING = 2
ERROR = 1
FATAL = 0
| code_fix | 3,586 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import GPy import numpy as np
from robo . task . rembo import REMBO
from robo . task . synthetic_functions . branin import Branin
robo . models . gpy_model import GPyModel
from robo . maximizers . cmaes import CMAES
from robo . solver . bayesian_optimization import BayesianOptimization
from robo . acquisition . ei import EI
| "str"
import GPy
import numpy as np
from robo . task . rembo import REMBO
from robo . task . synthetic_functions . branin import Branin
from robo . models . gpy_model import GPyModel
from robo . maximizers . cmaes import CMAES
from robo . solver . bayesian_optimization import BayesianOptimization
from robo . acquisition . ei import EI
| code_fix | 3,587 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import functools
import unittest
from peewee import *
from playhouse . test_utils import test_database
db1 = SqliteDatabase ( "str" )
db1 . _flag = "str" db2 = SqliteDatabase ( "str" )
db2 . _flag = "str"
| import functools
import unittest
from peewee import *
from playhouse . test_utils import test_database
db1 = SqliteDatabase ( "str" )
db1 . _flag = "str"
db2 = SqliteDatabase ( "str" )
db2 . _flag = "str"
| code_fix | 3,588 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
import random
ADJECTIVES = [ "str" , "str" , "str" , "str" , "str" "str" ,
"str" , "str" ] TOOLS = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" ]
| __author__ = "str"
import random
ADJECTIVES = [ "str" , "str" , "str" , "str" , "str" , "str" ,
"str" , "str" ]
TOOLS = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" ]
| code_fix | 3,589 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def hello ( name ) :
print ( "str" % name )
global timer
timer = threading . Timer ( 2.0 , hello , [ "str" ] )
timer . start )
| def hello ( name ) :
print ( "str" % name )
global timer
timer = threading . Timer ( 2.0 , hello , [ "str" ] )
timer . start ( )
| code_fix | 3,590 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class crm_case_stage ( Model )
_inherit = "str"
_columns = {
"str" : fields . many2one (
"str" , string = "str" ) ,
}
_defaults = {
"str" : lambda s , cr , uid , c : (
s . pool . get ( "str" ) . _get_company ( cr , uid , context = c ) ) , }
| class crm_case_stage ( Model ) :
_inherit = "str"
_columns = {
"str" : fields . many2one (
"str" , string = "str" ) ,
}
_defaults = {
"str" : lambda s , cr , uid , c : (
s . pool . get ( "str" ) . _get_company ( cr , uid , context = c ) ) ,
}
| code_fix | 3,591 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def wait_ready ( self ) :
while True :
if self . templates_ready ( ) == True :
print ( time . strftime "str" ) + "str" )
return True
else :
time . sleep ( 15 )
| def wait_ready ( self ) :
while True :
if self . templates_ready ( ) == True :
print ( time . strftime ( "str" ) + "str" )
return True
else :
time . sleep ( 15 )
| code_fix | 3,592 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_start_url ( self , response ) : ]
slp = Selector ( response )
for url in slp . xpath ( "str" ) . extract ( ) :
new_url = url
if judge_link ( new_url ) :
continue
yield Request ( new_url , callback = self . parse_article )
| def parse_start_url ( self , response ) :
slp = Selector ( response )
for url in slp . xpath ( "str" ) . extract ( ) :
new_url = url
if judge_link ( new_url ) :
continue
yield Request ( new_url , callback = self . parse_article )
| code_fix | 3,593 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def toggle ( self ) :
if self . fully_grown : self . is_growing and return self . burnt_out :
self . is_on_fire = not self . is_on_fire
self . flame_frame = 0
| def toggle ( self ) :
if self . fully_grown or self . is_growing and not self . burnt_out :
self . is_on_fire = not self . is_on_fire
self . flame_frame = 0
| code_fix | 3,594 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def initialize ) :
number_particles = eval ( raw_input ( "str" ) )
charge = eval ( raw_input ( "str" ) )
dimension = eval ( raw_input ( "str" ) )
max_variations = eval ( raw_input ( "str" ) )
thermalisation = eval ( raw_input ( "str" ) )
number_cycles = eval ( raw_input ( "str" ) )
step_length = eval ( raw_input ( "str" ) )
return number_particles , charge , dimension , max_variations , thermalisation , number_cycles , step_length
| def initialize ( ) :
number_particles = eval ( raw_input ( "str" ) )
charge = eval ( raw_input ( "str" ) )
dimension = eval ( raw_input ( "str" ) )
max_variations = eval ( raw_input ( "str" ) )
thermalisation = eval ( raw_input ( "str" ) )
number_cycles = eval ( raw_input ( "str" ) )
step_length = eval ( raw_input ( "str" ) )
return number_particles , charge , dimension , max_variations , thermalisation , number_cycles , step_length
| code_fix | 3,595 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def clean_youtube_text ( loop ) :
videos = Video . objects . all ( )
loop . run_until_complete asyncio . gather ( * [ clean_video ( video = video ) for video in videos ] , return_exceptions = True
) ) | def clean_youtube_text ( loop ) :
videos = Video . objects . all ( )
loop . run_until_complete ( asyncio . gather ( * [ clean_video ( video = video ) for video in videos ] , return_exceptions = True
) )
| code_fix | 3,596 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
import scipy
from search . chance_constraint_relaxation import ChanceConstraintRelaxation
from search . temporal_allocation import TemporalAllocation
from temporal_network . chance_constraint import ChanceConstraint
from search . candidate import Candidate
from search . conflict import NegativeCycle
from temporal_network . tpnu import FeasibilityType
from temporal_network . temporal_constraint import TemporalConstraint
from search . temporal_relaxation import TemporalRelaxation
import pysnopt . snopt snopt
import numpy as np
from scipy . stats import norm , truncnorm
prob_means = [ ]
prob_stds = [ ]
| __author__ = "str"
import scipy
from search . chance_constraint_relaxation import ChanceConstraintRelaxation
from search . temporal_allocation import TemporalAllocation
from temporal_network . chance_constraint import ChanceConstraint
from search . candidate import Candidate
from search . conflict import NegativeCycle
from temporal_network . tpnu import FeasibilityType
from temporal_network . temporal_constraint import TemporalConstraint
from search . temporal_relaxation import TemporalRelaxation
import pysnopt . snopt as snopt
import numpy as np
from scipy . stats import norm , truncnorm
prob_means = [ ]
prob_stds = [ ]
| code_fix | 3,597 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def install ( ) :
autotools . rawInstall ( "str" % get . installDIR ( ) ,
pisitools . removeDir ( "str" )
pisitools . dodoc ( "str" , "str" , "str" , "str" )
pisitools . dohtml ( "str" try
| def install ( ) :
autotools . rawInstall ( "str" % get . installDIR ( ) )
pisitools . removeDir ( "str" )
pisitools . dodoc ( "str" , "str" , "str" , "str" )
pisitools . dohtml ( "str" )
| code_fix | 3,598 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_link_header ( post ( ) :
"str"
assert response_has_link_header ( ) SHEAD ( "str" ) )
| def test_link_header ( post ) :
"str"
assert response_has_link_header ( SHEAD ( "str" ) )
| code_fix | 3,599 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
Subsets and Splits
Python Code Generation
Provides a structured view of code generation tasks specific to a Python-focused course, helping to understand the nature and sequence of the instructions and outputs.
Filtered Code Generation Tasks
The query extracts code generation questions and answers from a specific dataset source, offering structured insights into its contents.
Code Generation Instruction Split
The query processes and splits code generation outputs into separate answers, providing a structured view of potential alternative solutions for each instruction.
Filtered Code Generation Task
The query performs basic filtering and returns formatted data related to code generation tasks, which is helpful but does not provide deep insights into the dataset's underlying structure or patterns.
Code Generation Instructions
The query performs basic filtering to select code generation tasks and organizes them by license, source, and index, providing a simple overview but lacking deeper analytical insight.
Code Generation Instructions
The query performs basic filtering and selects specific columns, providing limited insight into the dataset's structure but not revealing deeper patterns or relationships.
Code Generation Instructions
The query performs basic filtering and selection, organizing code generation tasks by license and source but does not provide deep insights into the data.
^_Call_Call:::^_Call_Call:
The query performs basic filtering and selection, organizing code generation tasks by license, source, and index without revealing deeper insights.
^^^_Call.FromSeconds:^^ withheld^
The query performs basic filtering and ordering of dataset entries, providing a structured view but lacking deeper insights.
_Call^^^^^ serotonin^:^
The query performs basic data retrieval and organization, presenting specific fields in a structured format but without providing significant analytical insights.