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 SymbolASM ( Symbol ) :
"str"
def __init__ ( self , asm , lineno ) :
Symbol . __init__ ( self )
self . asm = asm
self . lineno = lineno
| このpythonコードに誤りはありません。 | code_fix | 3,900 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_extra ( self , extra ) :
"str"
if extra . startswith ( "str" ) :
extra = extra [ 1 : ]
r = IIIFRequest ( identifier = "str" ,
api_version = self . api_version )
r . parse_url ( extra )
if ( r . info ) :
raise IIIFStaticError ( "str" )
return ( r )
| このpythonコードに誤りはありません。 | code_fix | 3,901 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import division
from sympy import Symbol , pi , symbols , Tuple , S
from sympy . geometry import Curve , Line , Point , Ellipse , Ray , Segment , Circle , Polygon , RegularPolygon
from sympy . utilities . pytest import raises
| このpythonコードに誤りはありません。 | code_fix | 3,902 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import h5py
import numpy
import cPickle as pickle
import sys
| このpythonコードに誤りはありません。 | code_fix | 3,903 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run_xorgconf ( self ) :
if not self . backup_xorg_conf ( ) :
return False
print ( "str" )
return False
| このpythonコードに誤りはありません。 | code_fix | 3,904 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def detail ( request , language , slug ) :
flatpage = get_object_or_404 ( Flatpage , slug = slug , language = language )
return render_to_response ( "str" , { "str" : flatpage , "str" : language } ,
context_instance = RequestContext ( request ) )
| このpythonコードに誤りはありません。 | code_fix | 3,905 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def send_participation_request_rejected_email ( request , obj ) :
"str"
title = obj . project . short_name + "str"
mainportal = get_current_site ( request )
kwargs = { "str" : obj . user ,
"str" : request . user ,
"str" : mainportal ,
"str" : obj . project }
send_templated_email ( title , "str" , kwargs , [ obj . user . email ]
, "str" + mainportal . domain , fail_silently = False )
| このpythonコードに誤りはありません。 | code_fix | 3,906 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_size ( size ) :
"str"
if not size :
resources = dict ( cpus = DEFAULT_TASK_CPUS , mem = DEFAULT_TASK_MEM , disk = DEFAULT_TASK_DISK )
else :
try :
resources_ = json . loads ( size )
resources = dict (
cpus = float ( resources_ [ "str" ] ) ,
mem = parse_data ( resources_ [ "str" ] ) ,
disk = parse_data ( resources_ [ "str" ] ) )
except ( TypeError , KeyError , ValueError , InvalidData ) :
raise ValueError ( "str" )
return resources
| このpythonコードに誤りはありません。 | code_fix | 3,907 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_cc_2 ( self ) :
f = my_add2_cc ( )
src_data = ( 0 + 1j , 2 + 3j , 4 + 5j , 6 + 7j )
expected_result = ( 2 - 1j , 4 + 1j , 6 + 3j , 8 + 5j )
actual_result = tuple ( [ gr . feval_cc_example ( f , x ) for x in src_data ] )
self . assertEqual ( expected_result , actual_result )
| このpythonコードに誤りはありません。 | code_fix | 3,908 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_list_headers_with_alias ( capsys , tabularfile_2 ) :
"str"
tabularfile_2 . list_headers ( print_alias = True )
out , err = capsys . readouterr ( )
assert out == "str"
assert err == "str"
| このpythonコードに誤りはありません。 | code_fix | 3,909 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from safe . impact_functions . core import ( FunctionProvider ,
get_hazard_layer ,
get_exposure_layer ,
get_question ,
format_int )
from safe . storage . vector import Vector
from safe . storage . utilities import DEFAULT_ATTRIBUTE
from safe . common . utilities import ugettext as tr
from safe . common . tables import Table , TableRow
from safe . engine . interpolation import assign_hazard_values_to_exposure_data
import logging
LOGGER = logging . getLogger ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,910 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , request , delegate ) :
Servlet . __init__ ( self , request )
self . _delegate = delegate
| このpythonコードに誤りはありません。 | code_fix | 3,911 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , name , domain ) :
"str"
from pythonwhois import get_whois
self . whois = get_whois
self . _name = name
self . _domain = domain
self . _state = None
self . _data = None
self . _updated_date = None
self . _expiration_date = None
self . _name_servers = [ ]
| このpythonコードに誤りはありません。 | code_fix | 3,912 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import sys
if sys . version_info < ( 3 , 4 , 2 ) :
print ( "str" )
sys . exit ( 1 )
import json
import logging . config
import logging
import os
__version__ = "str"
__all__ = [ "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" , "str" ]
| このpythonコードに誤りはありません。 | code_fix | 3,913 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import random
import unittest
from mock import patch
from mock import MagicMock as Mock
import pyrax . cloudblockstorage
from pyrax . cloudblockstorage import CloudBlockStorageClient
from pyrax . cloudblockstorage import CloudBlockStorageVolume
from pyrax . cloudblockstorage import CloudBlockStorageVolumeType
from pyrax . cloudblockstorage import CloudBlockStorageSnapshot
from pyrax . cloudblockstorage import CloudBlockStorageSnapshotManager
from pyrax . cloudblockstorage import _resolve_id
from pyrax . cloudblockstorage import _resolve_name
from pyrax . cloudblockstorage import assure_volume
from pyrax . cloudblockstorage import assure_snapshot
import pyrax . exceptions as exc
from pyrax . manager import BaseManager
import pyrax . utils as utils
from pyrax import fakes
example_uri = "str"
| このpythonコードに誤りはありません。 | code_fix | 3,914 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __contains__ ( self , key ) :
"str"
return self . exists ( key ) or key in self . _empties
| このpythonコードに誤りはありません。 | code_fix | 3,915 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_args ( ) :
"str"
parser = argparse . ArgumentParser ( description = __doc__ )
parser . add_argument ( "str" , nargs = "str" , help = (
"str"
) )
parser . add_argument (
"str" , "str" , type = str ,
default = None ,
help = ( "str"
"str" ) )
parser . add_argument (
"str" , "str" , type = str ,
help = ( "str"
"str" ) )
return parser . parse_args ( )
| このpythonコードに誤りはありません。 | code_fix | 3,916 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MySQLLayer_Test ( LayerTest ) :
def setUp ( self ) :
self . skipIfNoDB ( "str" )
self . l = MySQL ( "str" ) . get ( "str" )
def testFormat ( self ) :
assert "str" == self . l . format
| このpythonコードに誤りはありません。 | code_fix | 3,917 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from gettext import gettext as _
import logging
import time
import uuid
from gi . repository import Gtk , Gdk
import gi
from netzob . Common . MMSTD . States . impl . NormalState import NormalState
from netzob . Common . MMSTD . MMSTD import MMSTD
from netzob . UI . Grammar . Views . EditStateView import EditStateView
gi . require_version ( "str" , "str" )
from gi . repository import GObject
| このpythonコードに誤りはありません。 | code_fix | 3,918 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Command ( BaseCommand ) :
def handle ( self , * args , ** kwargs ) :
log . info ( "str" )
try :
p = process . QueueProcessor ( )
p . start_polling ( )
except KeyboardInterrupt :
pass
except :
log . exception ( "str" )
log . info ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,919 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def invalidation_hash ( self , cli , document ) :
on_brace = document . current_char in self . chars
after_brace = document . char_before_cursor in self . chars
if on_brace :
return ( True , document . cursor_position )
elif after_brace and document . char_before_cursor in self . _closing_braces :
return ( True , document . cursor_position - 1 )
else :
return False
| このpythonコードに誤りはありません。 | code_fix | 3,920 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import sys
from PyQt4 import QtGui
app = QtGui . QApplication ( sys . argv )
w = QtGui . QWidget ( )
w . resize ( 300 , 200 )
w . move ( 100 , 100 )
w . setWindowTitle ( "str" )
w . show ( )
sys . exit ( app . exec_ ( ) )
| このpythonコードに誤りはありません。 | code_fix | 3,921 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import unittest
from langdetector import LanguageDetector
| このpythonコードに誤りはありません。 | code_fix | 3,922 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def to_mac ( self ) :
self . emit ( "str" )
return
| このpythonコードに誤りはありません。 | code_fix | 3,923 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def closeby ( nums1 , nums2 ) :
"str"
counts = 0
for i in range ( len ( nums1 ) ) :
if nums1 [ i ] != nums2 [ i ] and abs ( nums1 [ i ] - nums2 [ i ] ) < 3 :
counts += 1
return counts
| このpythonコードに誤りはありません。 | code_fix | 3,924 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CurrencySelectWidget ( forms . Select ) :
def __init__ ( self , attrs = None , choices = CURRENCY_CHOICES ) :
super ( CurrencySelectWidget , self ) . __init__ ( attrs , choices )
| このpythonコードに誤りはありません。 | code_fix | 3,925 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from PyQt4 import QtGui , QtCore , Qt
import dbutils as dbu
import qt_data_table_widget as dtw
import dbmodel as dbm
| このpythonコードに誤りはありません。 | code_fix | 3,926 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from openerp . osv import fields , osv
from openerp import tools
AVAILABLE_STATES = [
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" )
]
AVAILABLE_PRIORITIES = [
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" ) ,
( "str" , "str" )
]
| このpythonコードに誤りはありません。 | code_fix | 3,927 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def build_xcode_alltargets ( project , configuration ) :
print ( "str" % ( project , configuration ) )
proc = subprocess . Popen ( [ "str" , "str" , project , "str" , "str" , configuration , "str" ] , stdout = subprocess . PIPE , stderr = subprocess . PIPE )
for line in proc . stdout :
print_verbose ( line )
proc . wait ( )
if proc . returncode != 0 :
print ( "str" % proc . returncode )
raise
| このpythonコードに誤りはありません。 | code_fix | 3,928 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf . urls import url
from usr import views
from django . conf . urls import url
from usr . views import ( SignupView , LoginView )
urlpatterns = [
url ( "str" , SignupView . as_view ( ) , name = "str" ) ,
url ( "str" , LoginView . as_view ( ) , name = "str" ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 3,929 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def temperature ( self , temperature ) :
"str"
self . _temperature = temperature
| このpythonコードに誤りはありません。 | code_fix | 3,930 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import logging
from datetime import datetime
from pygram . app import PyGramApp
logger = logging . getLogger ( "str" )
if __name__ == "str" :
logging . basicConfig ( filename = "str" . format ( datetime . now ( ) . date ( ) ) )
PyGramApp ( ) . run ( )
| このpythonコードに誤りはありません。 | code_fix | 3,931 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def toggle_message_btn ( self ) :
if self . showMessages == True :
self . showMessages = False
else :
self . showMessages = True
self . textEdit . setVisible ( self . showMessages )
| このpythonコードに誤りはありません。 | code_fix | 3,932 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import socket
import sys
HOST , PORT = "str" , 9999
data = "str" . join ( sys . argv [ 1 : ] )
sock = socket . socket ( socket . AF_INET , socket . SOCK_STREAM )
try :
sock . connect ( ( HOST , PORT ) )
sock . sendall ( data + "str" )
received = sock . recv ( 1024 )
finally :
sock . close ( )
print ( "str" . format ( data ) )
print ( "str" . format ( received ) )
| このpythonコードに誤りはありません。 | code_fix | 3,933 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from Components . HTMLComponent import HTMLComponent
from Components . GUIComponent import GUIComponent
from Screen import Screen
from Components . ActionMap import ActionMap
from Components . Label import Label
from ServiceReference import ServiceReference
from enigma import eListboxPythonMultiContent , eListbox , gFont , iServiceInformation , eServiceCenter
from Tools . Transponder import ConvertToHumanReadable , getChannelNumber
import skin
RT_HALIGN_LEFT = 0
TYPE_TEXT = 0
TYPE_VALUE_HEX = 1
TYPE_VALUE_DEC = 2
TYPE_VALUE_HEX_DEC = 3
TYPE_SLIDER = 4
TYPE_VALUE_ORBIT_DEC = 5
TYPE_VALUE_FREQ = 6
TYPE_VALUE_FREQ_FLOAT = 7
TYPE_VALUE_BITRATE = 8
| このpythonコードに誤りはありません。 | code_fix | 3,934 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from sklearn . base import BaseEstimator , TransformerMixin
import numpy as np
| このpythonコードに誤りはありません。 | code_fix | 3,935 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def tabsborder_book ( self , button , notebook ) :
tval = False
bval = False
if self . show_tabs == False :
tval = True
if self . show_border == False :
bval = True
notebook . set_show_tabs ( tval )
self . show_tabs = tval
notebook . set_show_border ( bval )
self . show_border = bval
| このpythonコードに誤りはありません。 | code_fix | 3,936 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from lib import pingermaster
import redis
import json
import requests
| このpythonコードに誤りはありません。 | code_fix | 3,937 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
try :
from graph_gui import KeywordGraphGUI , draw_keyword_biclusters , construct_keyword_graph
except ImportError :
pass
| このpythonコードに誤りはありません。 | code_fix | 3,938 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def schedulePDF ( self ) :
self . driver = webdriver . Chrome ( executable_path = "str" )
self . driver . find_element_by_id ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,939 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def show_image ( self , image , ** options ) :
"str"
return self . show_file ( self . save_image ( image ) , ** options )
| このpythonコードに誤りはありません。 | code_fix | 3,940 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import fnmatch
import optparse
import os
import shutil
import subprocess
import struct
import sys
import tempfile
| このpythonコードに誤りはありません。 | code_fix | 3,941 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_image ( file_name ) :
return send_from_directory ( MEDIA_ROOT ,
file_name )
| このpythonコードに誤りはありません。 | code_fix | 3,942 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import random as random
no_of_rows = 1000000 ;
f = open ( "str" , "str" ) ;
col1 = range ( 0 , no_of_rows ) ;
col2 = col1 ;
col3 = range ( 0 , no_of_rows ) ;
random . shuffle ( col3 ) ;
for i in range ( 0 , no_of_rows ) :
row = str ( col1 [ i ] ) + "str" + str ( col2 [ i ] ) + "str" + str ( col3 [ i ] ) + "str" ;
f . write ( row ) ;
f . close ( ) ;
| このpythonコードに誤りはありません。 | code_fix | 3,943 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from hirsch import HImage , HDataCode2D
import hirsch . giv as giv
Filename = "str"
img = HImage . ReadImage ( Filename )
blobs = img . Threshold ( 0 , 128 ) . Connection ( )
blobs = [ b for b in blobs if b . Circularity ( ) > 0.5 ]
giv . ViewRegions ( blobs , image = img , props = [ "str" , "str" ] )
| このpythonコードに誤りはありません。 | code_fix | 3,944 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self ) :
super ( Core2VM , self ) . __init__ ( )
self . backup_content = False
| このpythonコードに誤りはありません。 | code_fix | 3,945 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def isSupported ( netInfo , options , baseline , logNames ) :
"str"
return baseline is not None and ( "str" in logNames ) and ( "str" in logNames )
| このpythonコードに誤りはありません。 | code_fix | 3,946 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def getsize ( font , text ) :
if hasattr ( font , "str" ) :
return tuple ( [ x + y for x , y in zip ( font . getsize ( text ) , font . getoffset ( text ) ) ] )
else :
return font . getsize ( text )
| このpythonコードに誤りはありません。 | code_fix | 3,947 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def remove_speakers ( txt ) :
speaker_pattern = re . compile ( "str" )
results = speaker_pattern . subn ( "str" , txt )
return results
| このpythonコードに誤りはありません。 | code_fix | 3,948 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , operands ) :
assert isinstance ( operands , list )
assert all ( [ isinstance ( operand , Expr ) for operand in operands ] )
assert operands != [ ]
self . operands = operands
| このpythonコードに誤りはありません。 | code_fix | 3,949 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def override_limits ( self , b ) :
if self . masked : return
self . emccommand . mode ( self . emc . MODE_MANUAL )
self . emccommand . override_limits ( )
| このpythonコードに誤りはありません。 | code_fix | 3,950 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Solution ( object ) :
import random
def __init__ ( self , nums ) :
"str"
self . nums = nums
def reset ( self ) :
"str"
return self . nums
def shuffle ( self ) :
"str"
return random . sample ( self . nums , len ( self . nums ) )
| このpythonコードに誤りはありません。 | code_fix | 3,951 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
a = input ( )
b = input ( )
for ch in a :
if ch in b :
a = a . replace ( ch , "str" , 1 )
b = b . replace ( ch , "str" , 1 )
for ch in b :
if ch in a :
b = b . replace ( ch , "str" , 1 )
a = a . replace ( ch , "str" , 1 )
print ( len ( a ) + len ( b ) )
| このpythonコードに誤りはありません。 | code_fix | 3,952 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_update_document ( self ) :
doc = self . card . schema ( docid = None )
ck = self . extension . add_checklist ( )
ck . set_title ( "str" )
ck . add_item_from_str ( "str" )
ck . add_item_from_str ( "str" )
ck = self . extension . add_checklist ( )
ck . set_title ( "str" )
ck . add_item_from_str ( "str" )
ck . add_item_from_str ( "str" )
self . extension . update_document ( doc )
self . assertEqual ( doc . checklists , "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,953 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function , unicode_literals
"str"
revision = "str"
down_revision = None
from alembic import op
import sqlalchemy as sa
import weblab . core . coordinator . sql . priority_queue_scheduler_model as pq_model
| このpythonコードに誤りはありません。 | code_fix | 3,954 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import unicode_literals , absolute_import , division , print_function
RGB_MIN_VALUE = 0
RGB_MAX_VALUE = 255
GRAYSCALE_MIN_VALUE = 0
GRAYSCALE_MAX_VALUE = 255
from . . import image
image . RGB_MIN_VALUE = RGB_MIN_VALUE
image . RGB_MAX_VALUE = RGB_MAX_VALUE
image . GRAYSCALE_MIN_VALUE = GRAYSCALE_MIN_VALUE
image . GRAYSCALE_MAX_VALUE = GRAYSCALE_MAX_VALUE
| このpythonコードに誤りはありません。 | code_fix | 3,955 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from collections import namedtuple
N , Student = int ( input ( ) ) , namedtuple ( "str" , input ( ) )
print ( "str" % ( sum ( float ( Student ( * input ( ) . split ( ) ) . MARKS ) for it in range ( N ) ) / N ) )
| このpythonコードに誤りはありません。 | code_fix | 3,956 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
times = input ( )
fibolist = [ 1 , 1 ]
fiboset = set ( fibolist )
for i in range ( times ) :
s = input ( )
while fibolist [ - 1 ] < s :
x = fibolist [ - 1 ] + fibolist [ - 2 ]
fibolist . append ( x )
fiboset . add ( x )
if s in fiboset :
print ( "str" )
elif fibolist [ - 1 ] > s :
print ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,957 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from t0mm0 . common . net import Net
from urlresolver . plugnplay . interfaces import UrlResolver
from urlresolver . plugnplay . interfaces import PluginSettings
from urlresolver . plugnplay import Plugin
import urllib , urllib2
from urlresolver import common
import re
| このpythonコードに誤りはありません。 | code_fix | 3,958 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def reinit ( self ) :
if self . __reset ( ) is not None :
if self . __open_comm ( ) is not None :
return True
return None
| このpythonコードに誤りはありません。 | code_fix | 3,959 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from ... helpers import get_allowed
import ast
import base64
import json
import os
import subprocess
import web
| このpythonコードに誤りはありません。 | code_fix | 3,960 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def unset_feature ( statedir , feature , host , value ) :
dirpath = os . path . join ( statedir , "str" , feature )
os . remove ( os . path . join ( dirpath , host ) )
try :
os . rmdir ( dirpath )
except Exception :
pass
| このpythonコードに誤りはありません。 | code_fix | 3,961 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Listener ( object ) :
def on_message_received ( self , msg ) :
raise NotImplementedError (
"str" . format (
self . __class__ . __name__ )
)
def __call__ ( self , msg ) :
return self . on_message_received ( msg )
def stop ( self ) :
"str"
| このpythonコードに誤りはありません。 | code_fix | 3,962 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from models import Post
from django import forms
from django . template . defaultfilters import slugify
| このpythonコードに誤りはありません。 | code_fix | 3,963 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _stats_result_aggregates ( self , result , aggregate ) :
stats_args = { }
for attr in Connection . STANDARD_AGGREGATES . keys ( ) :
if attr in result :
stats_args [ attr ] = result [ attr ]
if aggregate :
stats_args [ "str" ] = { }
for agr in aggregate :
stats_args [ "str" ] . update (
Connection . AGGREGATES [ agr . func ] . finalize (
result , agr . param , self . version ) )
return stats_args
| このpythonコードに誤りはありません。 | code_fix | 3,964 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def writeToFile ( self , * args , ** kwargs ) :
"str"
X , y , X_eval , ids , cols = self ( * args , ** kwargs )
print ( "str" )
np . savez ( "str" , X = X , y = y , X_eval = X_eval , ids = ids , cols = cols )
| このpythonコードに誤りはありません。 | code_fix | 3,965 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , path ) :
self . path = path
if not os . path . isfile ( self . path ) :
self . config = self . check ( { } )
self . save ( )
else :
self . config = self . check ( self . load ( ) )
| このpythonコードに誤りはありません。 | code_fix | 3,966 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import py_compile
import re
import sys
from os . path import join
verbose = "str" in sys . argv
delete_py = "str" in sys . argv
excludes = [ ]
exclude = re . compile ( "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,967 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function
import os
import json
import django
os . environ . setdefault ( "str" , "str" )
django . setup ( )
from eventkit_cloud . jobs . models import DatamodelPreset
osm = DatamodelPreset . objects . get ( name = "str" )
hdm = DatamodelPreset . objects . get ( name = "str" )
| このpythonコードに誤りはありません。 | code_fix | 3,968 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def require_app ( app_name , api_style = False ) :
"str"
iterable = ( inspect . getmodule ( frame [ 0 ] ) for frame in inspect . stack ( ) )
modules = [ module for module in iterable if module is not None ]
if api_style :
m = modules [ 2 ]
else :
m = modules [ 1 ]
m . _REQUIRED_APP = getattr ( m , "str" , [ ] )
m . _REQUIRED_APP . append ( app_name )
LOG . debug ( "str" , app_name , m . __name__ )
| このpythonコードに誤りはありません。 | code_fix | 3,969 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _listconfs ( request , conftemplates ) :
paginator = Paginator ( conftemplates , 10 )
page = request . GET . get ( "str" )
try :
conftemplates = paginator . page ( page )
except PageNotAnInteger :
conftemplates = paginator . page ( 1 )
except EmptyPage :
conftemplates = paginator . page ( paginator . num_pages )
return render ( request , "str" , {
"str" : conftemplates ,
} )
| このpythonコードに誤りはありません。 | code_fix | 3,970 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def fasta_iter ( fasta_name ) :
fh = open ( fasta_name )
faiter = ( x [ 1 ] for x in groupby ( fh , lambda line : line [ 0 ] == "str" ) )
for header in faiter :
headerStr = header . __next__ ( ) [ 1 : ] . strip ( )
seq = "str" . join ( s . strip ( ) for s in faiter . __next__ ( ) )
yield ( headerStr , seq )
| このpythonコードに誤りはありません。 | code_fix | 3,971 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
import pkg_resources
import filecmp
import numpy as np
import astropy . units as u
from matplotlib . testing . decorators import cleanup
from . . config import mmt_config
from . . telescope import MMT
from . . zernike import ZernikeVector
from . . custom_exceptions import WFSConfigException
| このpythonコードに誤りはありません。 | code_fix | 3,972 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_get_requested_orgs_get ( path , orgs , authorization , dc_app ) :
with dc_app . test_request_context ( path ,
method = "str" ) :
assert authorization . _get_requested_orgs ( flask . request ) == orgs
| このpythonコードに誤りはありません。 | code_fix | 3,973 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import mongoengine
try :
import users
from users import User
import invitations
from invitations import Invitation
except ImportError :
pass
import classes
from classes import Class
import assignments
from assignments import Assignment , TestHarness
import submissions
from submissions import Submission , TestResult
import archives
from archives import Archive
import csv
from csv import CSV
| このpythonコードに誤りはありません。 | code_fix | 3,974 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from . import mail_mail
from . import mail_mass_mailing
from . import mail_mass_mailing_list
from . import mail_unsubscription
| このpythonコードに誤りはありません。 | code_fix | 3,975 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import httplib2
from oslo_serialization import jsonutils as json
from oslotest import mockpatch
from tempest . services . compute . json import limits_client
from tempest . tests import base
from tempest . tests import fake_auth_provider
| このpythonコードに誤りはありません。 | code_fix | 3,976 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . contrib import admin
from . models import AppTasks
from . forms import TasksModelForm
| このpythonコードに誤りはありません。 | code_fix | 3,977 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import logging
from marrow . mailer import Message , Mailer
logging . basicConfig ( level = logging . INFO )
mail = Mailer ( {
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : 5
} )
mail . start ( )
message = Message ( [ ( "str" , "str" ) ] , [ ( "str" , "str" ) ] , "str" , plain = "str" )
mail . send ( message )
mail . stop ( )
| このpythonコードに誤りはありません。 | code_fix | 3,978 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Window ( QtGui . QWidget ) :
def __init__ ( self ) :
super ( Window , self ) . __init__ ( )
btn1 = QtGui . QPushButton ( "str" )
btn2 = QtGui . QPushButton ( "str" )
hbox = QtGui . QHBoxLayout ( )
hbox . addWidget ( btn1 )
hbox . addWidget ( btn2 )
vbox = QtGui . QVBoxLayout ( )
vbox . addLayout ( hbox )
self . setLayout ( vbox )
self . resize ( 250 , 150 )
self . setWindowTitle ( "str" )
self . show ( )
| このpythonコードに誤りはありません。 | code_fix | 3,979 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class GMTFormatter ( Formatter ) :
"str"
converter = time . gmtime
| このpythonコードに誤りはありません。 | code_fix | 3,980 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self ) :
super ( ) . __init__ ( )
self . load_scripts ( )
| このpythonコードに誤りはありません。 | code_fix | 3,981 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class EnvoyException ( Exception ) :
"str"
pass
| このpythonコードに誤りはありません。 | code_fix | 3,982 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import archive
archive . backupList ( )
| このpythonコードに誤りはありません。 | code_fix | 3,983 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_labels_and_descriptions ( instruments , bands ) :
"str"
labels = [ ]
descriptions = [ ]
for j in range ( len ( instruments ) ) :
masked = False
try : masked = instruments . mask [ j ]
except AttributeError : pass
if masked :
labels . append ( bands [ j ] )
descriptions . append ( bands [ j ] )
else :
labels . append ( instruments [ j ] )
descriptions . append ( instruments [ j ] + "str" + bands [ j ] )
return labels , descriptions
| このpythonコードに誤りはありません。 | code_fix | 3,984 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup
setup (
name = "str" ,
entry_points = {
"str" :
[
"str" ,
"str" ,
] ,
} ,
)
| このpythonコードに誤りはありません。 | code_fix | 3,985 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from django . conf . urls import url , include
from django . contrib import admin
from hostbody import views
urlpatterns = [
url ( "str" , admin . site . urls ) ,
url ( "str" , views . dashboard , name = "str" ) ,
url ( "str" , include ( "str" ) ) ,
url ( "str" , include ( "str" ) ) ,
url ( "str" , views . login_site , name = "str" ) ,
url ( "str" , views . logout_site , name = "str" ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 3,986 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def migrate ( env , version ) :
try :
env [ "str" ] . search (
[ ( "str" , "str" , [ "str" , "str" ] ) ] ) . compute_taxes ( )
except Exception :
pass
| このpythonコードに誤りはありません。 | code_fix | 3,987 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os
from setuptools import setup , find_packages
here = os . path . dirname ( __file__ )
| このpythonコードに誤りはありません。 | code_fix | 3,988 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import re
from datetime import datetime , timedelta
import json
from xml . etree import ElementTree
from scrapy . spider import BaseSpider
from scrapy . contrib . loader import ItemLoader
from scrapy . http import Request , Response , TextResponse
from scrapy . contrib . loader . processor import TakeFirst , MapCompose , Join
from scrapy . shell import inspect_response
from scrapy import log
from nrc . database import NrcDatabase
from nrc . NrcBot import NrcBot
| このpythonコードに誤りはありません。 | code_fix | 3,989 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def save ( self ) :
if self . is_dirty :
Mud . save ( self )
| このpythonコードに誤りはありません。 | code_fix | 3,990 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class DiagnosisRole ( models . Model ) :
_name = "str"
_description = "str"
_inherit = [ "str" ]
| このpythonコードに誤りはありません。 | code_fix | 3,991 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import sys
import os
import grade . util
| このpythonコードに誤りはありません。 | code_fix | 3,992 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def parse_timestamp_arg ( field , value ) :
res = str ( value )
try :
res = parse_timestamp ( res )
except ValueError as ex :
if ex . args :
o . fatal ( "str"
% ( field , value , ex ) )
else :
o . fatal ( "str" % ( field , value ) )
if res != 1 and res % 10 :
o . fatal ( "str" % ( field , value ) )
return res
| このpythonコードに誤りはありません。 | code_fix | 3,993 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Queue ( object ) :
items = [ ]
def enqueue ( self , value ) :
self . items . append ( value )
def dequeue ( self ) :
dequeued = self . items [ 0 ]
self . items = self . items [ 1 : ]
return dequeued
def peek ( self ) :
return self . items [ 0 ]
def __repr__ ( self ) :
return "str" + "str" . join ( [ str ( x ) for x in self . items ] ) + "str"
| このpythonコードに誤りはありません。 | code_fix | 3,994 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _get_color ( self ) :
color = Gdk . RGBA ( )
color . parse ( self . _color )
return color
| このpythonコードに誤りはありません。 | code_fix | 3,995 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def collect_data ( input_file ) :
container = [ ]
data_file = open ( input_file , "str" )
for line in data_file :
container . append ( line . strip ( "str" ) )
data_file . close ( )
return container
| このpythonコードに誤りはありません。 | code_fix | 3,996 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class VagasSpider ( Spider ) :
name = "str"
allowed_domains = [ "str" ]
start_urls = [ "str" ]
def parse ( self , response ) :
questions = Selector ( response ) . xpath ( "str" )
for question in questions :
item = VagasItem ( )
item [ "str" ] = question . xpath ( "str" ) . extract ( )
item [ "str" ] = question . xpath ( "str" ) . extract ( )
yield item
| このpythonコードに誤りはありません。 | code_fix | 3,997 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def lakshmi ( ) :
shares_bought = 2000
price_bought = 900
share_expense = price_bought * shares_bought
commission_bought = .03 * share_expense
total_expense = share_expense + commission_bought
shares_sold = 2000
price_sold = 942.75
sale_income = shares_sold * price_sold
commission_sold = .03 * sale_income
total_sale_income = sale_income - commission_sold
money = total_sale_income - total_expense
print ( money )
print ( "str" ) % ( money )
| このpythonコードに誤りはありません。 | code_fix | 3,998 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup , find_packages
long_desc = "str"
setup (
name = "str" ,
version = "str" ,
keywords = ( "str" , "str" , "str" , "str" ) ,
description = "str" ,
license = "str" ,
install_requires = [ ] ,
author = "str" ,
author_email = "str" ,
url = "str" ,
packages = find_packages ( ) ,
platforms = "str" ,
)
| このpythonコードに誤りはありません。 | code_fix | 3,999 | 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.