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
|
---|---|---|---|---|---|---|
def OnIpAddrChange ( self , event ) :
ipaddr = self . FindWindowById ( event . GetId ( ) )
if ipaddr . IsValid ( ) :
self . log . write ( "str" % ipaddr . GetAddress ( ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,100 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_world_array_to_fixed ( self ) :
w = [ [ - 1.0 , - 0.9 , 9.0 ] ,
[ 1.0 , 3.0 , 5.0 ] ,
[ 20.0 , 30.0 , 40.0 ] ]
assert_array_equal ( self . coords . world_to_fixed ( w ) ,
[ [ 0 , 1 , 100 ] ,
[ 20 , 40 , 60 ] ,
[ 210 , 310 , 410 ] ] )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,101 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def depFreeze ( dep ) :
words = [ ]
words . append ( _escapeName ( dep . name ) )
for flag , sense in sorted ( dep . flags . items ( ) ) :
words . append ( "str" % ( senseMap [ sense ] , _escapeFlags ( flag ) ) )
return words
|
このpythonコードに誤りはありません。
|
code_fix
| 5,102 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def wrapper ( func ) :
def func_wrap ( curses_screen ) :
screen = CursesScreen ( curses_screen )
try :
return func ( screen )
except :
logger . exception ( "str" )
raise
curses . wrapper ( func_wrap )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,103 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def get_hostnames ( self ) :
rawres = myparser . parser ( self . results , self . word )
return rawres . hostnames ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,104 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def user_roles ( ) :
"str"
user = session . get ( "str" , None )
if not user :
current_app . logger . warning ( "str" )
if current_app . config [ "str" ] :
current_app . logger . info ( "str" )
user = { }
user [ "str" ] = set ( [ USER_ROLE ] )
session . user = user
return user . get ( "str" , set ( ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,105 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from django . core . management . base import NoArgsCommand , CommandError
from atados_core . models import Nonprofit , UploadedImage
from optparse import make_option
import csv
import time
|
このpythonコードに誤りはありません。
|
code_fix
| 5,106 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def insertDailyBar ( self ) :
e = XH_HistoryDataEngine ( )
for vtSymbol in self . barDict :
e . downloadFuturesDailyBarSina ( vtSymbol )
if vtSymbol in self . activeSymbolDict :
activeSymbol = self . activeSymbolDict [ vtSymbol ]
e . downloadFuturesDailyBarSina ( activeSymbol )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,107 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_update_as_employee_wrong_user_id ( activity ) :
update_activities (
1 ,
params = activity ,
status = 403 ,
as_admin = False ,
resp_must_contain = "str"
"str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,108 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def get_image_cache_folder ( self , datastore , image_id ) :
"str"
return datastore . build_path ( self . _base_folder , image_id )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,109 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def install ( ) :
qt4 . install ( )
pisitools . dodoc ( "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,110 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import re
import ascpy
UNITS_RE = re . compile ( "str" ) ;
|
このpythonコードに誤りはありません。
|
code_fix
| 5,111 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import sys
sys . path . append ( "str" )
from pycompgeom . generators import *
from pycompgeom . visuals import *
from pycompgeom . events import *
while True :
s = VSegment2 ( )
VPoint2 ( random_point_on_segment ( s ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,112 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def testGrid ( grid , expected_sum , method ) :
global pass_cnt , fail_cnt
result = hungarian . solve ( grid , method )
if result [ 0 ] != expected_sum :
print ( "str" , method + "str" % ( expected_sum , result [ 0 ] ) )
fail_cnt += 1
else :
print ( "str" )
pass_cnt += 1
|
このpythonコードに誤りはありません。
|
code_fix
| 5,113 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from __future__ import unicode_literals
from django import forms
from django . contrib . auth import authenticate
from django . contrib . auth . forms import AuthenticationForm
from django . contrib . auth . models import User
from django . utils . translation import ugettext_lazy , ugettext as _
from bwp . models import TempUploadFile
ERROR_MESSAGE = ugettext_lazy (
"str"
"str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,114 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from __future__ import absolute_import
import itertools
from justbases import Radix
from hypothesis import strategies
|
このpythonコードに誤りはありません。
|
code_fix
| 5,115 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __parseValue ( self , value ) :
"str"
return MetricValue ( self . name , long ( value . group ( "str" ) ) , str ( value . group ( "str" ) ) , str ( value . group ( "str" ) ) , self . __recast ( str ( value . group ( "str" ) ) , str ( value . group ( "str" ) ) ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,116 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def check_arguments ( args , glo , loc ) :
globals ( ) . update ( glo )
locals ( ) . update ( loc )
if args . plugins :
plugins ( args )
else :
return False
return True
|
このpythonコードに誤りはありません。
|
code_fix
| 5,117 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from __future__ import absolute_import ;
import unittest ;
import sys ;
from tempfile import TemporaryFile ;
from cStringIO import StringIO ;
from cygapt . test . case import TestCase ;
from cygapt . url_opener import CygAptURLopener ;
|
このpythonコードに誤りはありません。
|
code_fix
| 5,118 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def clear_events ( self ) :
"str"
self . _events = [ ]
|
このpythonコードに誤りはありません。
|
code_fix
| 5,119 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __init__ ( self , * args , ** kwargs ) :
self . is_active = True
self . urlplayed = False
self . pdialogue = None
print ( "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,120 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class HasDeliveryPointBarcode ( Relationship , ValidFromMixin ) :
likelihood_of_match = models . FloatField ( blank = True , null = True )
class GraphMeta :
start_node_labels = ( "str" , )
end_node_labels = ( "str" , )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,121 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def action_start_working ( self ) :
result = super ( MrpProductionWorkcenterLine ,
self ) . action_start_working ( )
if self . routing_workcenter_qtemplate_ids :
for qtemplate in self . routing_workcenter_qtemplate_ids :
self . create_quality_test ( qtemplate )
if self . required_test :
self . create_quality_test ( self . qtemplate_id )
return result
|
このpythonコードに誤りはありません。
|
code_fix
| 5,122 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_contains ( self ) :
d = dominoes . Domino ( 1 , 2 )
self . assertTrue ( 1 in d )
self . assertTrue ( 2 in d )
self . assertFalse ( 3 in d )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,123 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from __future__ import unicode_literals
from django . db import models , migrations
import pg_fts . fields
from pg_fts . migrations import CreateFTSIndexOperation , CreateFTSTriggerOperation
|
このpythonコードに誤りはありません。
|
code_fix
| 5,124 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def print_result ( training_process ) :
if len ( training_process ) != 0 :
percentage_correct_answers = 100 / len ( training_process ) * ( training_process . count ( "str" ) + training_process . count ( "str" ) )
percentage_correct_answers = truncate_number ( percentage_correct_answers , 3 )
else :
percentage_correct_answers = 0.0
print ( "str" , len ( training_process ) , "str" , percentage_correct_answers , "str" , sep = "str" , end = "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,125 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def get_modelGBM ( ip , port ) :
h2o . init ( ip , port )
prostate = h2o . import_frame ( path = h2o . locate ( "str" ) )
prostate . describe ( )
prostate [ 1 ] = prostate [ 1 ] . asfactor ( )
prostate_gbm = h2o . gbm ( y = prostate [ 1 ] , x = prostate [ 2 : 9 ] , distribution = "str" )
prostate_gbm . show ( )
prostate_gbm . predict ( prostate )
model = h2o . get_model ( prostate_gbm . _id )
model . show ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,126 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_variant_creation_string ( self ) :
name = self . create_name ( )
theme = self . create_topic ( )
xsd_string = self . create_locator (
"str" )
variant = name . create_variant ( "str" , [ theme ] )
self . assertEqual ( "str" , variant . get_value ( ) )
self . assertEqual ( xsd_string , variant . get_datatype ( ) )
self . assertEqual ( 1 , variant . get_scope ( ) . count ( ) )
self . assertTrue ( theme in variant . get_scope ( ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,127 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class DiscoveryPromgen ( discovery . DiscoveryBase ) :
remote = False
"str"
def fetch ( self , farm_name ) :
"str"
farm = get_object_or_404 ( models . Farm , name = farm_name )
for host in models . Host . objects . filter ( farm = farm ) :
yield host . name
def farms ( self ) :
"str"
for farm in models . Farm . objects . filter ( source = discovery . FARM_DEFAULT ) :
yield farm . name
|
このpythonコードに誤りはありません。
|
code_fix
| 5,128 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def dan ( x ) :
result = "str"
for y in range ( 1 , 10 ) :
result = result + "str" % ( x * y )
return result
|
このpythonコードに誤りはありません。
|
code_fix
| 5,129 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from django . core . urlresolvers import reverse
from django . test import TestCase
from django . test . client import Client
from problemas . models import ProblemaUtilizado
from problemas . tests . utils_test import novo_problema
ITEM_MAIS_UTILIZADO = "str"
|
このpythonコードに誤りはありません。
|
code_fix
| 5,130 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import importlib
import unittest
try :
import unittest . mock as mock
except ImportError :
import mock
|
このpythonコードに誤りはありません。
|
code_fix
| 5,131 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def get_service_capabilities ( self , context ) :
"str"
return self . driver . get_service_capabilities ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,132 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class FixedIps ( extensions . V3APIExtensionBase ) :
"str"
name = "str"
alias = ALIAS
version = 1
def get_resources ( self ) :
member_actions = { "str" : "str" }
resources = extensions . ResourceExtension ( ALIAS ,
FixedIPController ( ) ,
member_actions = member_actions )
return [ resources ]
def get_controller_extensions ( self ) :
return [ ]
|
このpythonコードに誤りはありません。
|
code_fix
| 5,133 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def _onBrushSizeChange ( self , index ) :
"str"
newSize = self . brushSizes [ index ]
if self . editor . brushingModel . erasing :
self . eraserSizeIndex = index
self . editor . brushingModel . setBrushSize ( newSize )
else :
self . paintBrushSizeIndex = index
self . editor . brushingModel . setBrushSize ( newSize )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,134 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __new__ ( cls , * p , ** k ) :
inst = object . __new__ ( cls )
return inst
|
このpythonコードに誤りはありません。
|
code_fix
| 5,135 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import random
import tensorflow . python . platform
import numpy as np
from six . moves import xrange
import tensorflow as tf
from tensorflow . models . rnn import rnn
from tensorflow . models . rnn import rnn_cell
from tensorflow . models . rnn import seq2seq
|
このpythonコードに誤りはありません。
|
code_fix
| 5,136 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def body_onaccept ( form ) :
"str"
db = current . db
table = db . dvi_body
body = db ( table . id == form . vars . id ) . select ( table . uuid ,
table . location_id ,
table . track_id ,
table . date_of_recovery ,
limitby = ( 0 , 1 ) ) . first ( )
if body and body . location_id :
tracker = S3Tracker ( )
tracker ( record = body ) . set_location ( body . location_id ,
timestmp = body . date_of_recovery )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,137 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import job
from job import Core
from sampler import Sampler
import vis
import inference
from net import Net
from tracer import Tracer
import mpi
import util
|
このpythonコードに誤りはありません。
|
code_fix
| 5,138 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def verify_log_content ( filename , verification ) :
f = open ( filename , "str" )
log_content = f . read ( )
return ( verification in log_content )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,139 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def update_scheduler_hints ( scheduler_hints , added_servers , placement_group ) :
"str"
if placement_group . policy == "str" :
if "str" in scheduler_hints :
host_list = scheduler_hints [ "str" ]
else :
host_list = scheduler_hints [ "str" ] = [ ]
else :
if "str" in scheduler_hints :
host_list = scheduler_hints [ "str" ]
else :
host_list = scheduler_hints [ "str" ] = [ ]
for name in added_servers :
if name in placement_group . members :
host_list . append ( { "str" : name } )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,140 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class PKQuery ( Method ) :
"str"
def get_args ( self ) :
if self . obj . primary_key :
yield self . obj . primary_key . clone ( attribute = True , query = True )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,141 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __init__ ( self , other ) :
self . other = iter ( other )
self . lookahead = None
|
このpythonコードに誤りはありません。
|
code_fix
| 5,142 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_string_type_raises_error ( ) :
schema = {
"str" : INTEGER ,
}
validator = generate_validator_from_schema ( schema )
with pytest . raises ( ValidationError ) as err :
validator ( "str" )
assert "str" in err . value . messages [ 0 ]
assert_error_message_equal (
err . value . messages [ 0 ] [ "str" ] [ 0 ] ,
MESSAGES [ "str" ] [ "str" ] ,
)
|
このpythonコードに誤りはありません。
|
code_fix
| 5,143 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __init__ ( self , keys ) :
self . keys = keys
self . minvals = dict ( ( key , + np . Inf ) for key in keys )
self . maxvals = dict ( ( key , - np . Inf ) for key in keys )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,144 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def async_select_value ( self , value ) :
"str"
if len ( value ) < self . _minimum or len ( value ) > self . _maximum :
_LOGGER . warning ( "str" ,
value , self . _minimum , self . _maximum )
return
self . _current_value = value
yield from self . async_update_ha_state ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,145 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
import numpy as np
from numpy . testing import assert_allclose as ac
from vispy . util import keys
from phy . electrode . mea import staggered_positions
from phy . gui import GUI
from phy . io . mock import artificial_waveforms
from phy . utils import Bunch
from . . waveform import WaveformView
|
このpythonコードに誤りはありません。
|
code_fix
| 5,146 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import os
import sys
from pyramid . paster import get_appsettings , setup_logging
from pyramid . scripts . common import parse_vars
from sqlalchemy . ext . compiler import compiles
from sqlalchemy . schema import CreateTable
from . . schema import get_engine , Persistable
|
このpythonコードに誤りはありません。
|
code_fix
| 5,147 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def header ( self ) :
for header in self . _doc . get_drawings ( ) . get_headers ( ) :
if header . name == self . _headers . currentText ( ) :
return header
return None
|
このpythonコードに誤りはありません。
|
code_fix
| 5,148 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_without_num_days_weight_reminder ( self ) :
user = User . objects . get ( pk = 2 )
user . email = "str"
user . save ( )
user . userprofile . num_days_weight_reminder = 0
user . userprofile . save ( )
call_command ( "str" )
self . assertEqual ( len ( mail . outbox ) , 0 )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,149 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from __future__ import absolute_import as _abs
import ctypes
import sys as _sys
import numpy as np
from . . base import _LIB
from . . base import c_array , py_str , c_str , mx_uint , _Null
from . . base import NDArrayHandle , OpHandle
from . . base import check_call
from . . ndarray_doc import _build_doc
|
このpythonコードに誤りはありません。
|
code_fix
| 5,150 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import os
from scipy import misc
import numpy as np
from sklearn . decomposition import TruncatedSVD
from scipy . sparse import csr_matrix
from sklearn . cluster import KMeans
|
このpythonコードに誤りはありません。
|
code_fix
| 5,151 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from . import l10n_fr_hr_payroll
from . import res_config_settings
|
このpythonコードに誤りはありません。
|
code_fix
| 5,152 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
__RCSID__ = "str"
import sys
import DIRAC
from DIRAC . Core . Base import Script
from DIRAC . FrameworkSystem . Client . ProxyUpload import CLIParams , uploadProxy
if __name__ == "str" :
cliParams = CLIParams ( )
cliParams . registerCLISwitches ( )
Script . parseCommandLine ( )
retVal = uploadProxy ( cliParams )
if not retVal [ "str" ] :
print ( retVal [ "str" ] )
sys . exit ( 1 )
sys . exit ( 0 )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,153 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
revision = "str"
down_revision = "str"
from alembic import op
from neutron . db import migration
TABLE_NAME = "str"
PK_NAME = "str"
|
このpythonコードに誤りはありません。
|
code_fix
| 5,154 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def configure_logging ( self , config ) :
logging . basicConfig ( format = config . logging . format ,
level = config . logging . level )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,155 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from setuptools import setup
setup ( name = "str" ,
version = "str" ,
description = "str" ,
classifiers = [
"str" ,
( "str" )
] ,
keywords = "str" ,
author = "str" ,
author_email = "str" ,
license = "str" ,
packages = [ "str" ]
)
|
このpythonコードに誤りはありません。
|
code_fix
| 5,156 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
import re
from parser_tools import find_re , find_tokens , find_token , check_token
lyxtable_re = re . compile ( "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,157 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import pygame
import constants
import platforms
|
このpythonコードに誤りはありません。
|
code_fix
| 5,158 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def get_pickled_exception ( exc ) :
"str"
if isinstance ( exc , UnpickleableExceptionWrapper ) :
return exc . restore ( )
return exc
|
このpythonコードに誤りはありません。
|
code_fix
| 5,159 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
compra = int ( input ( "str" ) )
if compra <= 100 :
print ( "str" )
elif compra > 100 :
print ( "str" )
else :
print ( "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,160 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from __future__ import print_function
import argparse
import sys
import tagger . config
|
このpythonコードに誤りはありません。
|
code_fix
| 5,161 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class ThreeDSecureTest ( StripeResourceTest ) :
def test_threedsecure_create ( self ) :
stripe . ThreeDSecure . create (
card = "str" ,
amount = 1500 ,
currency = "str" ,
return_url = "str"
)
self . requestor_mock . request . assert_called_with (
"str" ,
"str" ,
{
"str" : "str" ,
"str" : 1500 ,
"str" : "str" ,
"str" : "str"
} ,
None
)
|
このpythonコードに誤りはありません。
|
code_fix
| 5,162 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from pyof . v0x04 . controller2switch . multipart_request import FlowStatsRequest
from tests . test_struct import TestStruct
|
このpythonコードに誤りはありません。
|
code_fix
| 5,163 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def testOperations ( self ) :
d1 = datetime . date ( 2010 , 4 , 9 )
d2 = datetime . date ( 2010 , 6 , 13 )
diff = d2 - d1
self . assertEqual ( diff . days , 65 )
self . assertEqual ( str ( d1 + diff ) , "str" )
self . assertEqual ( str ( d1 - diff ) , "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,164 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from __future__ import print_function
import numpy
import pyferret
import scipy . stats
|
このpythonコードに誤りはありません。
|
code_fix
| 5,165 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class Colorable ( Device ) :
@ property
def hue ( self ) :
return self . get ( "str" )
@ hue . setter
def hue ( self , value ) :
return self . set ( { "str" , value } )
@ property
def saturation ( self ) :
return self . get ( "str" )
@ saturation . setter
def saturation ( self , value ) :
return self . set ( { "str" , value } )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,166 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def collect ( ) :
"str"
collection = [ ]
try :
yield collection
finally :
try :
import cPickle as pickle
except ImportError :
import pickle
with open ( "str" , "str" ) as f :
pickle . dump ( collection , f , - 1 )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,167 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def recommended_solver ( cypher_text ) :
x = "str"
y = "str"
trans_table = str . maketrans ( x , y )
return cypher_text . translate ( trans_table )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,168 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def addCallbackChain ( self , callbacks ) :
"str"
leap_assert_type ( callbacks , list )
self . _signal_to_emit = None
self . _err_msg = None
d = None
for cb , sig in callbacks :
if d is None :
d = threads . deferToThread ( cb )
else :
d . addCallback ( partial ( self . _callback_threader , cb ) )
d . addErrback ( self . _errback , signal = sig )
d . addCallback ( self . _gui_notify , signal = sig )
d . addErrback ( self . _gui_errback )
return d
|
このpythonコードに誤りはありません。
|
code_fix
| 5,169 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def __init__ ( self , root , max_candidates ) :
self . root = root
if self . __class__ . native is None :
self . __class__ . native = ctypes . CDLL ( SONAME )
for export in PROTOTYPES :
restype , argtypes = PROTOTYPES [ export ]
obj = getattr ( self . __class__ . native , export )
obj . restype = restype
obj . argtypes = argtypes
self . max_candidates = max_candidates
self . create ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,170 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def testLossFromDifferentGraph ( self ) :
with ops . Graph ( ) . as_default ( ) :
loss = constant_op . constant ( 1. )
with ops . Graph ( ) . as_default ( ) , self . test_session ( ) :
with self . assertRaisesRegexp (
ValueError , "str" ) :
model_fn . EstimatorSpec (
mode = model_fn . ModeKeys . TRAIN ,
loss = loss ,
train_op = control_flow_ops . no_op ( ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,171 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import csv
from pandas import DataFrame
import pickle
f = open ( "str" , "str" )
columns = "str" . split ( "str" )
info = [ ]
for curline in csv . reader ( f ) :
try :
int ( curline [ 0 ] )
info . append ( curline [ 0 : 6 ] )
except :
pass
df = DataFrame ( info , columns = columns )
df . index = df [ "str" ]
df = df . drop ( "str" , axis = 1 )
df . to_csv ( "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,172 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def testEncodeOpaque ( self ) :
val = "str"
opt = ETag ( val )
popt = "str" + val
self . assertEqual ( popt , encode_options ( [ opt ] ) )
( opts , remaining ) = decode_options ( popt )
self . assertEqual ( "str" , remaining )
self . assertTrue ( isinstance ( opts , list ) )
self . assertEqual ( 1 , len ( opts ) )
opt = opts [ 0 ]
self . assertTrue ( isinstance ( opt , ETag ) )
self . assertEqual ( val , opt . value )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,173 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def EntriesPageNo ( self , page_no , token ) :
qs = urllib . parse . urlencode ( [ ( "str" , page_no ) , ( "str" , token ) ] )
response = self . session . get (
"str" % qs )
response . encoding = "str"
return response . text
|
このpythonコードに誤りはありません。
|
code_fix
| 5,174 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def on_resize ( self , event ) :
self . generate_grid ( )
self . rotate_arrows ( np . array ( self . last_mouse ) )
vp = ( 0 , 0 , self . physical_size [ 0 ] , self . physical_size [ 1 ] )
self . context . set_viewport ( * vp )
self . visual . transforms . configure ( canvas = self , viewport = vp )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,175 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import logging
from django . conf import settings
from corehq . apps . hqwebapp . tasks import send_mail_async , mail_admins_async
from corehq . util . log import get_sanitized_request_repr
from corehq . util . global_request import get_request
from corehq . util . soft_assert . core import SoftAssert
logger = logging . getLogger ( "str" )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,176 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class LoadableIcon ( __gobject . GInterface ) :
def load ( self , size = None , cancellable = None ) :
"str"
pass
def load_async ( self , callback , size = None , cancellable = None , user_data = None ) :
"str"
pass
def load_finish ( self , res ) :
"str"
pass
def __init__ ( self , * args , ** kwargs ) :
pass
__gtype__ = None
|
このpythonコードに誤りはありません。
|
code_fix
| 5,177 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def from_outlook_fmt ( self ) :
self . start = strptime ( self . start , self . outlook_date_format )
self . end = strptime ( self . end , self . outlook_date_format )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,178 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def make_entries ( start , end ) :
entries = [ ]
for i in range ( start , end + 1 ) :
entry = client_pb2 . EntryResponse ( )
entry . leaf_input = "str" % i
entry . extra_data = "str" % i
entries . append ( ( i , entry ) )
return entries
|
このpythonコードに誤りはありません。
|
code_fix
| 5,179 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import phlgitx_refcache
import phlsys_git
import phlsys_pid
import phlurl_watcher
import abdi_processrepoarglist
import abdi_repoargs
import abdt_differresultcache
import abdt_fs
import abdt_git
|
このpythonコードに誤りはありません。
|
code_fix
| 5,180 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from . core import Item , Field , MapField , prepare
from . magic import MagicField
MAGIC = MagicField ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,181 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_find_tests_app_config ( base_dir , target , toolchain_name , app_config ) :
"str"
set_targets_json_location ( )
with patch ( "str" ) as mock_scan_resources , patch ( "str" ) as mock_prepare_toolchain :
mock_scan_resources ( ) . inc_dirs . return_value = [ ]
find_tests ( base_dir , target , toolchain_name , app_config = app_config )
args = mock_prepare_toolchain . call_args
assert "str" in args [ 1 ] , "str"
assert args [ 1 ] [ "str" ] == app_config , "str"
|
このpythonコードに誤りはありません。
|
code_fix
| 5,182 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from django . contrib import admin
from . models import (
Industry ,
Priority ,
)
|
このpythonコードに誤りはありません。
|
code_fix
| 5,183 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
from __future__ import ( absolute_import , division , generators , nested_scopes , print_function ,
unicode_literals , with_statement )
from pants . backend . codegen . ragel . java . java_ragel_library import JavaRagelLibrary
from pants . base . deprecated import deprecated_module
deprecated_module ( "str" , "str" )
JavaRagelLibrary = JavaRagelLibrary
|
このpythonコードに誤りはありません。
|
code_fix
| 5,184 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
"str"
import os
import pickle
import time
import unittest as test
import auth_data
import pecoff_blob
|
このpythonコードに誤りはありません。
|
code_fix
| 5,185 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def strip_html_tags ( html ) :
"str"
return bleach . clean ( html , tags = [ ] , attributes = { } , strip = True )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,186 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
import os
from django . core . files import File
from nose . tools import eq_
from kitsune . groups . models import GroupProfile
from kitsune . groups . tests import GroupProfileFactory
from kitsune . sumo . templatetags . jinja_helpers import urlparams
from kitsune . sumo . tests import TestCase
from kitsune . sumo . urlresolvers import reverse
from kitsune . users . tests import UserFactory , GroupFactory , add_permission
|
このpythonコードに誤りはありません。
|
code_fix
| 5,187 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def refresh_token ( self , strategy , * args , ** kwargs ) :
token = self . extra_data . get ( "str" ) or self . extra_data . get ( "str" )
backend = self . get_backend ( strategy )
if token and backend and hasattr ( backend , "str" ) :
backend = backend ( strategy = strategy )
response = backend . refresh_token ( token , * args , ** kwargs )
if self . set_extra_data ( response ) :
self . save ( )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,188 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class BaseError ( Exception ) :
"str"
pass
|
このpythonコードに誤りはありません。
|
code_fix
| 5,189 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def Rechts ( cmd ) :
keyboardInput = "str"
print ( "str" )
m1 . move ( - 0.5 )
sleep ( 0.2 )
m1 . move ( 0.0 )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,190 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class W3WQuery ( MultipleResultsQuery ) :
"str"
provider = "str"
method = "str"
_URL = "str"
_RESULT_CLASS = W3WResult
_KEY = w3w_key
def _build_params ( self , location , provider_key , ** kwargs ) :
return {
"str" : location ,
"str" : provider_key ,
}
def _adapt_results ( self , json_response ) :
return [ json_response ]
|
このpythonコードに誤りはありません。
|
code_fix
| 5,191 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class DNSProvider ( base . Driver ) :
def __init__ ( self , conf ) :
super ( DNSProvider , self ) . __init__ ( conf )
def is_alive ( self ) :
return False
@ property
def dns_name ( self ) :
return "str"
@ property
def service_controller ( self ) :
return controllers . ServicesController ( self )
@ property
def retry_exceptions ( self ) :
"str"
return retry_exceptions
|
このpythonコードに誤りはありません。
|
code_fix
| 5,192 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def test_c ( ) :
from . . codata2010 import c
assert c . value == 2.99792458e8
assert c . si . value == 2.99792458e8
assert c . cgs . value == 2.99792458e10
assert c . uncertainty == 0
assert c . name
assert c . reference
assert c . unit
|
このpythonコードに誤りはありません。
|
code_fix
| 5,193 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def is_options_expression ( s ) :
return is_string ( s ) and bool ( re . match (
"str" +
"str" +
"str" , s ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,194 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
class UnbatchDoFn ( beam . DoFn ) :
"str"
def process ( self , element ) :
for item in element :
yield item
|
このpythonコードに誤りはありません。
|
code_fix
| 5,195 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
def predict_proba ( self , X ) :
"str"
assert self . _is_fitted ( ) , "str"
X = self . _transform_data ( self . _get_features ( X , allow_nans = True ) )
return self . exp . network . predict_proba ( X . astype ( numpy . float32 ) )
|
このpythonコードに誤りはありません。
|
code_fix
| 5,196 |
MIT
|
bifi
|
次に示すpythonコードの誤りを修正しなさい。
|
!python3 -m pip install jax
|
code_generation
| 5,197 |
Apache-2.0
|
jax_60_exercise
|
pythonを用いて、jaxパッケージをインストールしなさい。
|
|
import jax
|
code_generation
| 5,198 |
Apache-2.0
|
jax_60_exercise
|
pythonのjaxを用いて、jaxパッケージをインポートしなさい。
|
|
jax.__version__
|
code_generation
| 5,199 |
Apache-2.0
|
jax_60_exercise
|
pythonのjaxを用いて、jaxのバージョンを表示しなさい。
|
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.