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 |
|---|---|---|---|---|---|---|
from django . conf . urls import url
from . import views
urlpatterns = [
url ( "str" , views . index , name = "str" ) ,
url ( "str" , views . detail , name = "str" ) ,
url ( "str" , views . delete_resource , name = "str" ) ,
url ( "str" , views . delete_item , name = "str" ) ,
url ( "str" , views . groups_index , name = "str" ) ,
url ( "str" , views . groups_detail , name = "str" ) ,
url ( "str" , views . groups_delete , name = "str" ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,400 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from twilio . rest import TwilioRestClient
account_sid = "str"
auth_token = "str"
client = TwilioRestClient ( account_sid , auth_token )
account = client . accounts . update (
"str" , status = "str"
)
print ( account . date_created )
| このpythonコードに誤りはありません。 | code_fix | 4,401 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_case_dates ( self ) :
dates = [ ]
path = self . base_path + "str" . format ( id = self . court_identifier )
for s in self . html . xpath ( path ) :
s = self . grouping_regex . search ( s ) . group ( 3 )
dates . append ( date . fromtimestamp ( time . mktime ( time . strptime ( s , "str" ) ) ) )
return dates
| このpythonコードに誤りはありません。 | code_fix | 4,402 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def finddirs ( indir ) :
files = os . listdir ( indir )
dirs = [ ]
for file in files :
if os . path . isdir ( os . path . join ( indir , file ) ) :
dirs . append ( file )
return dirs
| このpythonコードに誤りはありません。 | code_fix | 4,403 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CheckTest ( unittest . TestCase ) :
def testCheck ( self ) :
ret = ngsutils . bam . check . bam_check ( os . path . join ( os . path . dirname ( __file__ ) , "str" ) , quiet = True )
self . assertEqual ( ret , True )
def testCheckFail ( self ) :
ret = ngsutils . bam . check . bam_check ( os . path . join ( os . path . dirname ( __file__ ) , "str" ) , quiet = True )
self . assertEqual ( ret , False )
| このpythonコードに誤りはありません。 | code_fix | 4,404 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def index ( ) :
form = NameForm ( )
if form . validate_on_submit ( ) :
session [ "str" ] = form . name . data
return redirect ( url_for ( "str" ) )
return render_template ( "str" , current_time = datetime . utcnow ( ) , form = form , name = session . get ( "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,405 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from MaKaC . common . general import *
from MaKaC import archives
if DEVELOPEMENT :
archives = reload ( archives )
| このpythonコードに誤りはありません。 | code_fix | 4,406 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from ui . screen . screen import Screen
from ui . menu . languagemenu import LanguageMenu
from util . util import KEY_LANGUAGE
| このpythonコードに誤りはありません。 | code_fix | 4,407 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Version ( BuiltinCommand ) :
"str"
name = "str"
def run ( self , args , config ) :
print ( envbuilder . __version__ )
| このpythonコードに誤りはありません。 | code_fix | 4,408 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def handle_noargs ( self , ** options ) :
self . count = 0
connections = [ self . test_echo ( ) for _ in range ( self . CLIENTS ) ]
asyncio . get_event_loop ( ) . run_until_complete ( asyncio . wait ( connections ) )
assert self . count == 0
| このpythonコードに誤りはありません。 | code_fix | 4,409 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run ( self ) :
self . define_path ( )
data , marker , num = self . read_data ( )
win = self . win_display ( )
result , win = self . RSVP_paradigm ( data , 0.1 , win , marker )
ti = self . calculate_ti ( result [ 1 ] )
self . plot_ti ( ti )
print ( data , marker )
| このpythonコードに誤りはありません。 | code_fix | 4,410 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def find_user ( identity_client , name_or_id , domain_name_or_id = None ) :
domain_id = _get_domain_id_if_requested ( identity_client , domain_name_or_id )
if not domain_id :
return _find_identity_resource ( identity_client . users , name_or_id ,
users . User )
else :
return _find_identity_resource ( identity_client . users , name_or_id ,
users . User , domain_id = domain_id )
| このpythonコードに誤りはありません。 | code_fix | 4,411 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _on_switch_pressed ( self ) :
_LOGGER . debug ( "str" , self . _name )
self . _state = True
self . _hass . async_add_job ( self . async_update_ha_state ( ) )
| このpythonコードに誤りはありません。 | code_fix | 4,412 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Exception ( Exception ) :
def __unicode__ ( self ) :
try :
return "str" . join ( [ unicode ( arg ) for arg in self . args ] )
except UnicodeDecodeError :
return "str" . join ( [ str ( arg ) . decode ( "str" ) for arg in self . args ] )
| このpythonコードに誤りはありません。 | code_fix | 4,413 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os , sys
import unittest
import inspect
from opengrid . library . houseprint import houseprint
| このpythonコードに誤りはありません。 | code_fix | 4,414 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def roi_editor_table_changed ( self , row , column ) :
_row = row
try :
row_variables = self . get_row ( row = _row )
except ValueError :
return
list_roi = self . parent . list_roi [ self . title ]
list_roi [ _row ] = row_variables
self . parent . list_roi [ self . title ] = list_roi
| このpythonコードに誤りはありません。 | code_fix | 4,415 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from . import freeimage
from . import freeimagemulti
from . import example
from . import dicom
from . import ffmpeg
from . import npz
| このpythonコードに誤りはありません。 | code_fix | 4,416 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import time
from scipy . sparse . linalg import spsolve
from numpy import linalg , Inf , exp , r_ , conj , angle , matrix , empty , abs as npabs
| このpythonコードに誤りはありません。 | code_fix | 4,417 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def testSerializeSingle ( self ) :
self . assertEqual (
serializers . serialize ( "str" , self . poll1 ) ,
{ "str" : self . poll1 . pub_date , "str" : self . poll1 . question , "str" : self . poll1 . id , "str" : [ x . id for x in self . poll1 . tags . all ( ) ] }
)
| このpythonコードに誤りはありません。 | code_fix | 4,418 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def equation2 ( xy , d = 7.62 , G = 0.5305 , rhop = 7.51 , ut = 399 ) :
"str"
ep , uc = xy
g = 981
f1 = 2 * g * d * ( ( ep ** - 4.7 ) - 1 ) - 0.01 * ( uc / ep - ut ) ** 2
f2 = G - ( uc / ep - ut ) * rhop * ( 1 - ep )
return f1 , f2
| このpythonコードに誤りはありません。 | code_fix | 4,419 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def define ( name , t ) :
if isinstance ( t , basestring ) :
t = _parse_type ( t )
_types [ name ] = t
for token in re . findall ( "str" , name ) :
_keywords . add ( token )
return t
| このpythonコードに誤りはありません。 | code_fix | 4,420 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from pymcutil . command . command import Command
from . . _execute_command import ExecuteCommand
CMD = "str"
| このpythonコードに誤りはありません。 | code_fix | 4,421 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class HerdsHandler ( AnonymousBaseHandler ) :
allowed_methods = ( "str" , )
def read ( self , request ) :
herds = Package . objects . herds ( rename = True )
return { "str" : herds }
| このpythonコードに誤りはありません。 | code_fix | 4,422 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os
from base64 import b64encode , b64decode
from flask import abort , g , request , session
from itsdangerous import (
JSONWebSignatureSerializer , constant_time_compare , bytes_to_int ,
int_to_bytes
)
from werkzeug . routing import NotFound
_exempt_views = [ ]
| このpythonコードに誤りはありません。 | code_fix | 4,423 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def assert_has_id ( element ) :
assert ( element [ "str" ] [ "str" ] is not None )
assert ( element [ "str" ] [ "str" ] != "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,424 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import mock
import webob . exc
from neutron . api . v2 import attributes
from neutron . extensions import securitygroup as ext_sg
from neutron . plugins . mlnx . db import mlnx_db_v2 as mlnx_db
from neutron . tests . unit import test_extension_security_group as test_sg
from neutron . tests . unit import test_security_groups_rpc as test_sg_rpc
PLUGIN_NAME = ( "str"
"str" )
NOTIFIER = ( "str"
"str" )
| このpythonコードに誤りはありません。 | code_fix | 4,425 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , session , sp_playlistcontainer , add_ref = True ) :
super ( PlaylistContainer , self ) . __init__ ( )
self . _session = session
if add_ref :
lib . sp_playlistcontainer_add_ref ( sp_playlistcontainer )
self . _sp_playlistcontainer = ffi . gc (
sp_playlistcontainer , lib . sp_playlistcontainer_release )
self . _sp_playlistcontainer_callbacks = None
self . _lib = lib
| このpythonコードに誤りはありません。 | code_fix | 4,426 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __getattr__ ( self , attr ) :
cursor_attr = getattr ( self . cursor , attr )
if attr in CursorWrapper . WRAP_ERROR_ATTRS :
return self . db . wrap_database_errors ( cursor_attr )
else :
return cursor_attr
| このpythonコードに誤りはありません。 | code_fix | 4,427 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
try :
import cPickle as pickle
except ImportError :
import pickle
| このpythonコードに誤りはありません。 | code_fix | 4,428 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , template , template_directory , args , timeout = 5 ) :
self . timeout = timeout
self . delay = None
self . mode = None
databank = slave_db . SlaveBase ( template )
modbus . Server . __init__ (
self , databank if databank else modbus . Databank ( ) )
self . _get_mode_and_delay ( template )
self . remove_all_slaves ( )
self . _configure_slaves ( template )
| このpythonコードに誤りはありません。 | code_fix | 4,429 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def isMultiline ( s ) :
"str"
return ( s . find ( "str" ) != - 1 )
| このpythonコードに誤りはありません。 | code_fix | 4,430 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def json_file_to_list ( filename , config = None ) :
"str"
with open ( filename ) as fp :
return json . load ( fp )
| このpythonコードに誤りはありません。 | code_fix | 4,431 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def setState ( self , state ) :
W , b = state
self . W . set_value ( new_value = W , borrow = True )
self . b . set_value ( new_value = b , borrow = True )
| このpythonコードに誤りはありません。 | code_fix | 4,432 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_utf8 ( self ) :
self . assertFileErrors ( "str" , [ ] )
self . assertFileErrors ( "str" , [ ] )
self . assertFileErrors ( "str" , [
"str" ,
] )
self . assertFileErrors ( "str" , [
"str" ,
] )
self . assertFileErrors ( "str" , [
"str" ,
] )
| このpythonコードに誤りはありません。 | code_fix | 4,433 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def onclick ( ) :
print ( "str" )
w . setText ( "str" )
w . resize ( w . sizeHint ( ) )
| このpythonコードに誤りはありません。 | code_fix | 4,434 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def excerpt_step ( nsamples , nexcerpts = None , excerpt_size = None ) :
step = max ( ( nsamples - excerpt_size ) // ( nexcerpts - 1 ) ,
excerpt_size )
return step
| このpythonコードに誤りはありません。 | code_fix | 4,435 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import mock
from heatclient . v1 import events
from heatclient . v1 import resources
from heatclient . v1 import software_deployments as deployments
from heatclient . v1 import stacks
from congress . datasources import datasource_utils as ds_utils
from congress . datasources import heatv1_driver
from congress . tests import base
from congress . tests import helper
| このpythonコードに誤りはありません。 | code_fix | 4,436 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MochParser ( ) :
def parse_schema ( self , schema ) :
return "str"
| このpythonコードに誤りはありません。 | code_fix | 4,437 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def findDirs ( path , matching ) :
out = [ ]
for root , dirnames , filenames in os . walk ( path ) :
for dirName in fnmatch . filter ( dirnames , matching ) :
out . append ( os . path . join ( root , dirName ) )
return out
| このpythonコードに誤りはありません。 | code_fix | 4,438 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def generate_zk_auth_json ( ) :
auth = {
"str" : [
{
"str" : "str" ,
"str" : "str"
}
] ,
"str" : [
{
"str" : "str" ,
"str" : "str" ,
"str" : {
"str" : True ,
"str" : True ,
"str" : True ,
"str" : True ,
"str" : False
}
}
]
}
return json . dumps ( auth )
| このpythonコードに誤りはありません。 | code_fix | 4,439 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def check_auth_publickey ( self , username , key ) :
print ( "str" + hexlify ( key . get_fingerprint ( ) ) . decode ( ) )
if ( username == "str" ) and ( key == self . good_pub_key ) :
return paramiko . AUTH_SUCCESSFUL
return paramiko . AUTH_FAILED
| このpythonコードに誤りはありません。 | code_fix | 4,440 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_template_name ( self , request ) :
"str"
if not hasattr ( self , "str" ) :
raise AttributeError ( "str"
"str"
% self . __class__ . __name__ )
return self . template_name
| このpythonコードに誤りはありません。 | code_fix | 4,441 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DefaultChain ( Chain ) :
"str"
def __init__ ( self , default , left ) :
"str"
super ( DefaultChain , self ) . __init__ ( left , None )
self . default = default
def __call__ ( self , value , ** flags ) :
"str"
try :
return self . left ( value , ** flags )
except TransformationException :
return self . default
def __lshift__ ( self , other ) :
return self . left >> other >> Default ( self . default )
| このpythonコードに誤りはありません。 | code_fix | 4,442 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CourseAdmin ( admin . ModelAdmin ) :
list_display = [ "str" , "str" , "str" , "str" ]
search_fields = [ "str" , "str" ]
prepopulated_fields = { "str" : ( "str" , ) }
| このpythonコードに誤りはありません。 | code_fix | 4,443 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import url ;
from . import views ;
app_name = "str" ;
urlpatterns = [
url ( "str" , views . player , name = "str" ) ,
url ( "str" , views . play , name = "str" ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,444 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def backwards ( self , orm ) :
db . add_column ( "str" , "str" ,
self . gf ( "str" ) ( default = 1 , to = orm [ "str" ] ) ,
keep_default = False )
db . add_column ( "str" , "str" ,
self . gf ( "str" ) ( default = 1 , to = orm [ "str" ] ) ,
keep_default = False )
| このpythonコードに誤りはありません。 | code_fix | 4,445 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Migration ( migrations . Migration ) :
dependencies = [
( "str" , "str" ) ,
]
operations = [
migrations . AddField (
model_name = "str" ,
name = "str" ,
field = models . TextField ( null = True , blank = True , verbose_name = "str" ) ,
) ,
migrations . AddField (
model_name = "str" ,
name = "str" ,
field = models . CharField ( null = True , blank = True , verbose_name = "str" , max_length = 255 ) ,
) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,446 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import absolute_import
try :
import scipy . special
_is_scipy = True
except ImportError as e :
_is_scipy = False
import numpy as np
from . . utils import chunk , cycle_colors
from . . _builder import Builder , create_and_build
from ... models import ColumnDataSource , GlyphRenderer , Range1d
from ... models . glyphs import Line , Quad
from ... properties import Bool , Float , Int
| このpythonコードに誤りはありません。 | code_fix | 4,447 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
fclist = "str"
FIELDCODES = { }
for line in fclist . split ( "str" ) :
byte , value = line . split ( "str" )
FIELDCODES [ int ( byte ) ] = value
| このpythonコードに誤りはありません。 | code_fix | 4,448 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class TokenizedCorpusWriter ( TarredCorpusWriter ) :
"str"
def document_to_raw_data ( self , doc ) :
return "str" . join ( "str" . join ( sentence ) for sentence in doc )
| このpythonコードに誤りはありません。 | code_fix | 4,449 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_form_valid ( self ) :
view = setup_form_view ( self . view , self . request , self . form )
view . form_valid ( self . form )
nt . assert_equal (
Conference . find ( Q ( "str" , "str" , data [ "str" ] ) ) . count ( ) ,
1
)
| このpythonコードに誤りはありません。 | code_fix | 4,450 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class vtkFeatureEdges ( SimpleVTKClassModuleBase ) :
def __init__ ( self , module_manager ) :
SimpleVTKClassModuleBase . __init__ (
self , module_manager ,
vtk . vtkFeatureEdges ( ) , "str" ,
( "str" , ) , ( "str" , ) ,
replaceDoc = True ,
inputFunctions = None , outputFunctions = None )
| このpythonコードに誤りはありません。 | code_fix | 4,451 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def series ( cls , series_id ) :
url = settings . SERIES_URL . format (
api_key = settings . API_KEY ,
series_id = series_id
)
data = cls . _get ( url )
root_node = ET . fromstring ( data )
return Series ( root_node )
| このpythonコードに誤りはありません。 | code_fix | 4,452 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def index ( self , req , server_id ) :
context = req . environ [ "str" ]
authorize ( context , action = "str" )
instance = common . get_instance ( self . _compute_api , context , server_id )
networks = common . get_networks_for_instance ( context , instance )
return self . _view_builder . index ( networks )
| このpythonコードに誤りはありません。 | code_fix | 4,453 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_middleware_software ( self ) :
"str"
for i in ( "str" , "str" , "str" , "str" , "str" ) :
response = self . client . get ( reverse ( "str" . format ( i ) ) )
self . assertFalse ( response . get ( "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,454 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from random import *
import numpy as np
| このpythonコードに誤りはありません。 | code_fix | 4,455 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MyUserCreationForm ( UserCreationForm ) :
class Meta :
model = User
field = ( "str" , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,456 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def writeDotOutput ( g , out ) :
dot = [ "str" % ( n1 , n2 , g [ n1 ] [ n2 ] [ "str" ] ) for ( n1 , n2 ) in g . edges ( ) ]
f = codecs . open ( out , "str" , encoding = "str" )
f . write ( "str" % "str" . join ( dot ) )
f . close ( )
| このpythonコードに誤りはありません。 | code_fix | 4,457 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from __future__ import unicode_literals
from datetime import datetime
import logging
import os
import re
| このpythonコードに誤りはありません。 | code_fix | 4,458 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import operator
import numpy as np
| このpythonコードに誤りはありません。 | code_fix | 4,459 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from rpclib . protocol . xml . model . _base import null_to_parent_element
from rpclib . protocol . xml . model . _base import base_to_parent_element
from rpclib . protocol . xml . model . _base import base_from_element
| このpythonコードに誤りはありません。 | code_fix | 4,460 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def SetFilter ( self , r , f , db ) :
c = self . smodel . filtruj ( r , f , db )
return c
| このpythonコードに誤りはありません。 | code_fix | 4,461 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import time
from twisted . web import resource
from twisted . python import failure
from twisted . internet import task
from coherence . upnp . core . soap_service import UPnPPublisher
from coherence . upnp . core . soap_service import errorCode
from coherence . upnp . core import service
from coherence . upnp . core . DIDLLite import build_dlna_additional_info
from coherence import log
| このpythonコードに誤りはありません。 | code_fix | 4,462 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def shell_quote ( arguments ) :
def quote ( string ) :
return "str" . join ( "str" + p + "str" for p in string . split ( "str" ) )
return "str" . join ( map ( quote , arguments ) )
| このpythonコードに誤りはありません。 | code_fix | 4,463 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def getSubs ( self ) :
data = { }
for parameter in self :
data . update ( parameter . getSub ( ) )
return data
| このpythonコードに誤りはありません。 | code_fix | 4,464 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _mk_pcb ( self , exp = 0 ) :
return create_mock_full ( {
"str" : "str" , "str" : 42 ,
"str" : exp , "str" : ( 1 , 2 ) ,
"str" : ( 3 , 4 ) , "str" : True , "str" : "str" ,
} )
| このpythonコードに誤りはありません。 | code_fix | 4,465 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _oneshot_tick ( func ) :
"str"
@ functools . wraps ( func )
def wrapped ( self , * args , ** kwargs ) :
if self . status == common . Status . FAILURE or self . status == common . Status . SUCCESS :
yield self
else :
for child in func ( self , * args , ** kwargs ) :
yield child
return wrapped
| このpythonコードに誤りはありません。 | code_fix | 4,466 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _digitDV ( sw , ructb ) :
j = 2
nsuma = 0
for c in reversed ( ructb ) :
if sw and j == 12 :
sw = False
j -= 1
nsuma += j * ( ord ( c ) - ord ( "str" ) )
j += 1
r = nsuma % 11
if r > 1 : return 11 - r
return 0
| このpythonコードに誤りはありません。 | code_fix | 4,467 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class IPAMRootView ( routers . APIRootView ) :
"str"
def get_view_name ( self ) :
return "str"
| このpythonコードに誤りはありません。 | code_fix | 4,468 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_use_twisted_no_twisted ( ) :
try :
import twisted
return
except ImportError :
pass
import txaio
try :
txaio . use_twisted ( )
assert "str"
except ImportError :
pass
assert not txaio . using_twisted
assert txaio . using_asyncio
| このpythonコードに誤りはありません。 | code_fix | 4,469 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Migration ( migrations . Migration ) :
dependencies = [
( "str" , "str" ) ,
]
operations = [
migrations . AddField (
model_name = "str" ,
name = "str" ,
field = models . BooleanField ( default = 0 ) ,
preserve_default = False ,
) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,470 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__source__ = "str"
import unittest
import collections
| このpythonコードに誤りはありません。 | code_fix | 4,471 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from tempest . api . network import base
from tempest . common . utils import data_utils
from tempest . test import attr
| このpythonコードに誤りはありません。 | code_fix | 4,472 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from bottle import ServerAdapter
import threading
import gevent
import os
| このpythonコードに誤りはありません。 | code_fix | 4,473 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from . gpio_tests import suite as gpio_suite
import unittest
suite = unittest . TestSuite ( )
suite . addTest ( gpio_suite )
| このpythonコードに誤りはありません。 | code_fix | 4,474 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_vtk_data_source ( self ) :
"str"
self . check ( )
| このpythonコードに誤りはありません。 | code_fix | 4,475 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def process_children ( self , node , elem , module , path ) :
"str"
for ch in node . i_children :
if ch . i_config or self . doctype == "str" :
self . node_handler [ ch . keyword ] ( ch , elem , module , path )
| このpythonコードに誤りはありません。 | code_fix | 4,476 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def fetch_or_create_character ( self , character_name ) :
character = Character . query . filter ( func . lower ( Character . name ) == func . lower ( character_name ) ) . first ( )
if not character :
character = Character ( character_name )
db . session . add ( character )
db . session . commit
return character
| このpythonコードに誤りはありません。 | code_fix | 4,477 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_config ( token , url , id ) :
api_call = "str" + id + "str"
headers = { "str" : token }
url += api_call
response = requests . get ( url , headers = headers , verify = False ) . json ( )
return response
| このpythonコードに誤りはありません。 | code_fix | 4,478 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django import forms
from django . contrib . admin . forms import AdminAuthenticationForm as AdminAuthForm
try :
from django . contrib . admin . forms import ERROR_MESSAGE
except ImportError :
ERROR_MESSAGE = AdminAuthForm . error_messages [ "str" ]
from django . contrib . auth import authenticate
from django . contrib . auth . forms import AuthenticationForm as AuthForm
from django . utils . translation import ugettext_lazy as _
| このpythonコードに誤りはありません。 | code_fix | 4,479 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import pytest
import mfr
from mfr . ext . code_pygments import Handler as CodeFileHandler
from mfr . ext . code_pygments . render import get_stylesheet , render_html
from mfr . ext . code_pygments . configuration import config
HERE = os . path . dirname ( os . path . abspath ( __file__ ) )
| このpythonコードに誤りはありません。 | code_fix | 4,480 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class SeleniumWrapper ( object ) :
_instance = None
def __new__ ( cls , * args , ** kwargs ) :
if not cls . _instance :
cls . _instance = super ( SeleniumWrapper , cls ) . __new__ ( cls , * args , ** kwargs )
return cls . _instance
def getDriver ( self ) :
self . driver = DRIVER
return self . driver
| このpythonコードに誤りはありません。 | code_fix | 4,481 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . core . management . base import BaseCommand
from django . db import connection
from partners . models import (
Agreement ,
CountryProgramme
)
from users . models import Country
| このpythonコードに誤りはありません。 | code_fix | 4,482 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def select_clock ( self , clock_type ) :
"str"
clock_type = clock_type . upper ( )
if clock_type == "str" or clock_type == "str" :
blockmon . select_clock ( clock_type )
return ReturnValue ( ReturnValue . CODE_SUCCESS , "str" , None )
return ReturnValue ( ReturnValue . CODE_FAILURE , "str" , None )
| このpythonコードに誤りはありません。 | code_fix | 4,483 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def my_odd_iter ( ) :
mn = 1
while True :
mn += 2
yield mn
| このpythonコードに誤りはありません。 | code_fix | 4,484 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import unicode_literals
from datetime import datetime
from . db . models . managers import CommonManager
from . db . models . managers import TokenManager
| このpythonコードに誤りはありません。 | code_fix | 4,485 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def message ( s ) :
vide = ( largeur - len ( s ) ) / 2
debut = hauteur / 2 - 2
ecran . addstr ( int ( Plateau . TAILLE_MAX / 2 ) , Plateau . TAILLE_MAX + 5 , s )
ecran . nodelay ( False )
ecran . getch ( )
| このpythonコードに誤りはありません。 | code_fix | 4,486 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def hash_string ( s ) :
hash_object = hashlib . md5 ( "str" % s )
return str ( hash_object . hexdigest ( ) )
| このpythonコードに誤りはありません。 | code_fix | 4,487 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , config ) :
"str"
self . values = dict ( [ ( node . key , node . value ) for node in config . children ] )
| このpythonコードに誤りはありません。 | code_fix | 4,488 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def setup ( ) :
client = Client ( config . endpoint , config . username , config . password )
org = client . get_organization ( config . organization )
print ( "str" )
try :
org . environments ( ) . create ( "str" , "str" )
except :
pass
importer = Import ( )
importer . import_application ( org , "str" )
importer . import_application ( org , "str" )
importer . import_application ( org , "str" )
print ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,489 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def Main ( ) :
config = { }
with open ( "str" , "str" ) as f :
config = json . load ( f )
Session = POFSession . POFSession ( )
Session . Criteria = config [ "str" ]
Session . login ( config [ "str" ] [ "str" ] , config [ "str" ] [ "str" ] )
userIDs = Session . getOnlineUsers ( 30 , False )
for userID in userIDs :
Session . sendEmail ( userID , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,490 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function
import argparse
import os
import sys
from time import strftime
import numpy as np
from nets import create_cnn3d_det_string
from data_creation import load_patch_batch_percent , load_thresholded_norm_images_by_name
from data_creation import load_patch_vectors_by_name_pr , load_patch_vectors_by_name
from nibabel import load as load_nii
from data_manipulation . metrics import dsc_seg , tp_fraction_seg , fp_fraction_seg
| このpythonコードに誤りはありません。 | code_fix | 4,491 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_memoryCheckerFailsPassword ( self ) :
"str"
return self . assertFailure ( self . checker . requestAvatarId ( self . badPass ) ,
error . UnauthorizedLogin )
| このpythonコードに誤りはありません。 | code_fix | 4,492 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_mask_size ( self , maskfile ) :
img = self . get_image ( maskfile )
return np . count_nonzero ( img )
| このpythonコードに誤りはありません。 | code_fix | 4,493 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class ContinuousActionLinearPolicy ( object ) :
def __init__ ( self , theta , n_in , n_out ) :
assert len ( theta ) == ( n_in + 1 ) * n_out
self . W = theta [ 0 : n_in * n_out ] . reshape ( n_in , n_out )
self . b = theta [ n_in * n_out : None ] . reshape ( 1 , n_out )
def act ( self , ob ) :
a = ob . dot ( self . W ) + self . b
return a
| このpythonコードに誤りはありません。 | code_fix | 4,494 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class stockage :
def __init__ ( self , path ) :
self . repo = Repo ( path )
pass
def saveFile ( self ) :
pass
def getFile ( self ) :
pass
| このpythonコードに誤りはありません。 | code_fix | 4,495 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def response ( ctx , flow ) :
try :
if re . match ( "str" , flow . response . headers [ "str" ] [ 0 ] ) :
flow . response . decode ( )
oldtxt = flow . response . content
newtxt = oldtxt . replace ( "str" , "str" )
newtxt = newtxt . replace ( "str" , "str" )
flow . response . content = str ( newtxt )
except IndexError :
ctx . log ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,496 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def clip ( x , mn , mx ) :
if x > mx :
return mx
if x < mn :
return mn
return x
| このpythonコードに誤りはありません。 | code_fix | 4,497 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_save ( self ) :
coupon = Coupon ( type = "str" , value = 100 )
coupon . save ( )
self . assertTrue ( coupon . pk )
| このpythonコードに誤りはありません。 | code_fix | 4,498 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def vldMaskForAnd ( a , b ) :
a_vld = ( a . vldMask & ~ a . val )
b_vld = ( b . vldMask & ~ b . val )
vld = ( a . vldMask & b . vldMask ) | a_vld | b_vld
return vld
| このpythonコードに誤りはありません。 | code_fix | 4,499 | 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.