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 |
|---|---|---|---|---|---|---|
"str"
from __future__ import absolute_import
import subprocess
import threading
import salt . exceptions
from salt . ext import six
| このpythonコードに誤りはありません。 | code_fix | 4,100 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_pixbuf_from_image ( image ) :
"str"
is_rgba = image . mode == "str"
if is_rgba : rowstride = 4
else : rowstride = 3
pb = gtk . gdk . pixbuf_new_from_data (
image . tobytes ( ) ,
gtk . gdk . COLORSPACE_RGB ,
is_rgba ,
8 ,
image . size [ 0 ] ,
image . size [ 1 ] ,
( is_rgba and 4 or 3 ) * image . size [ 0 ]
)
return pb
| このpythonコードに誤りはありません。 | code_fix | 4,101 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class TestLagrange ( TestCase ) :
def test_lagrange ( self ) :
p = poly1d ( [ 5 , 2 , 1 , 4 , 3 ] )
xs = np . arange ( len ( p . coeffs ) )
ys = p ( xs )
pl = lagrange ( xs , ys )
assert_array_almost_equal ( p . coeffs , pl . coeffs )
| このpythonコードに誤りはありません。 | code_fix | 4,102 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CustomNotice ( Notice ) :
name = "str"
identifier = "str"
html_template = "str"
text_template = "str"
context = { "str" : "str" }
subject = "str" % ( "str" , context [ "str" ] )
| このpythonコードに誤りはありません。 | code_fix | 4,103 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from django . conf import urls
from horizon . browsers import views
from zaqar_ui . content . queues import panel
title = panel . Queues . name
urlpatterns = [
urls . url ( "str" , views . AngularIndexView . as_view ( title = title ) , name = "str" ) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,104 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import unicode_literals
import barbados . barbadosdb . fields
from django . conf import settings
from django . db import migrations , models
import django . db . models . deletion
| このpythonコードに誤りはありません。 | code_fix | 4,105 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def GetSubtitles ( self , subs ) :
import base64
import gzip
return gzip . decompress (
base64 . b64decode (
self . DownloadSubtitles ( self . _token , ( subs [ "str" ] , ) ) [ "str" ] [ 0 ] [ "str" ] )
)
| このpythonコードに誤りはありません。 | code_fix | 4,106 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_invoice_model ( cls ) :
if isinstance ( cls . invoice_model , models . Model ) :
return cls . invoice_model
elif isinstance ( cls . invoice_model , string_types ) :
return resolve_model_string ( cls . invoice_model , cls . _meta . app_label )
else :
raise ValueError ( "str" . format (
cls . __name__ , cls . invoice_model ) )
| このpythonコードに誤りはありません。 | code_fix | 4,107 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def render_to_response ( self , context ) :
"str"
return self . get_json_response ( self . convert_context_to_json ( context ) )
| このpythonコードに誤りはありません。 | code_fix | 4,108 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def count_total_giving ( self ) :
total = self . current_year ( ) . counted ( ) . giving ( ) . aggregate ( total_points = models . Sum ( "str" ) ) [ "str" ]
if total is None :
return 0
else :
return total
| このpythonコードに誤りはありません。 | code_fix | 4,109 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def update ( self ) :
if not self . visible :
return False
if self . grabbed :
pygame . display . update ( ( self . px , self . py , self . width + 4 , self . height + 4 ) )
pygame . display . update ( ( self . x , self . y , self . width + 4 , self . height + 4 ) )
| このpythonコードに誤りはありません。 | code_fix | 4,110 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def post_save_config_entity_initial_publishers ( cls ) :
"str"
post_save_config_entity_initial . connect ( user_publishing . on_config_entity_post_save_group , cls , True , "str" )
post_save_config_entity_initial . connect ( user_publishing . on_config_entity_post_save_user , cls , True , "str" )
post_save_config_entity_initial . connect ( built_form_publishing . on_config_entity_post_save_built_form , cls , True , "str" )
post_save_config_entity_initial . connect ( policy_publishing . on_config_entity_post_save_policy , cls , True , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,111 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from flask import Flask
from flask import render_template , abort , flash , request
from flask_bootstrap import Bootstrap
from flask_wtf import Form
from wtforms import StringField , SubmitField , BooleanField
from wtforms . validators import DataRequired
from flask . ext . sqlalchemy import SQLAlchemy
from flask . ext . login import current_user , login_required
from flask . ext . security import Security , SQLAlchemyUserDatastore , UserMixin , RoleMixin
import os
import wtf_helpers
| このpythonコードに誤りはありません。 | code_fix | 4,112 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class BasePageTests ( TestCase ) :
def test_cleanup_html ( self ) :
b = Page ( )
self . assertEqual ( b . cleanup_html ( "str" ) , "str" )
self . assertEqual ( b . cleanup_html ( "str" ) ,
"str" )
self . assertEqual ( b . cleanup_html ( "str" ) ,
"str" )
| このpythonコードに誤りはありません。 | code_fix | 4,113 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def preprocessContent ( self , url , mimetype , contentstr ) :
soup = common . util . WebRequest . as_soup ( contentstr )
text = soup . body . get_text ( strip = True ) . strip ( )
if len ( text ) < 100 or True :
self . log . info ( "str" )
contentstr , dummy_fileN , dummy_mType = self . wg . chromiumGetRenderedItem ( url )
else :
self . log . info ( "str" , len ( text ) )
return contentstr
| このpythonコードに誤りはありません。 | code_fix | 4,114 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def handle ( self , * args , ** options ) :
if options . get ( "str" ) :
self . ku_openlearning ( options . get ( "str" ) , options . get ( "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,115 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import os
from logging . config import dictConfig
| このpythonコードに誤りはありません。 | code_fix | 4,116 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import tensorflow as tf
import numpy as np
from datetime import datetime
a = str ( datetime . now ( ) ) [ 11 : 19 ]
print ( a )
| このpythonコードに誤りはありません。 | code_fix | 4,117 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
if __name__ == "str" :
foo = 1
print ( VAR )
| このpythonコードに誤りはありません。 | code_fix | 4,118 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class MockStatusUpdater ( object ) :
"str"
def __init__ ( self , addr = "str" , uuid = "str" , api_key = "str" ) :
self . addr = addr
self . _uuid = uuid
self . _daemon_addr = "str" . format ( self . addr )
self . _api_key = api_key
self . status = { }
def update ( self , status ) :
"str"
self . status = status
print ( self . status )
| このpythonコードに誤りはありません。 | code_fix | 4,119 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def tearDown ( self ) :
for gr in UserGroupModel . get_all ( ) :
fixture . destroy_user_group ( gr )
Session ( ) . commit ( )
| このpythonコードに誤りはありません。 | code_fix | 4,120 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def main ( ) :
favourite_number = raw_input ( "str" )
print ( "str" )
pickle . dump ( favourite_number , open ( "str" , "str" ) )
print ( "str" )
unpickled_number = pickle . load ( open ( "str" , "str" ) )
print ( "str" % unpickled_number )
| このpythonコードに誤りはありません。 | code_fix | 4,121 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def related_objects ( model ) :
return [
( _verbose_name ( rel ) , rel )
for rel in _related ( model ) ]
| このpythonコードに誤りはありません。 | code_fix | 4,122 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , * args , ** kwargs ) :
super ( NumentaDetector , self ) . __init__ ( * args , ** kwargs )
self . model = None
self . sensorParams = None
self . anomalyLikelihood = None
self . useLikelihood = True
| このpythonコードに誤りはありません。 | code_fix | 4,123 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class PermissionsSerializer ( serializers . ModelSerializer ) :
class Meta :
model = Permissions
| このpythonコードに誤りはありません。 | code_fix | 4,124 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def controllerChange ( self , controller , val , channel = 1 ) :
midimsg = 0xB0 + ( ( controller ) * 0x100 ) + ( val * 0x10000 ) + channel
mm = c_int ( midimsg )
rc = self . winmm . midiOutShortMsg ( self . hmidi , mm )
if rc != 0 :
raise Win32MidiException ( "str" + self . midiOutShortErrorCodes . get ( rc , "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,125 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def custom_identity_handler ( payload ) :
user = datastore . find_user ( id = payload [ "str" ] )
return user
| このpythonコードに誤りはありません。 | code_fix | 4,126 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_teardown_delete_network ( self , utils_mock ) :
id = "str"
utils_mock . return_value = ( "str" , None )
network . teardown_network ( id )
utils_mock . assert_called_with ( "str" , "str" , "str" , id ,
run_as_root = True )
| このpythonコードに誤りはありません。 | code_fix | 4,127 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def setupSignals ( self ) :
self . textChanged . connect ( self . needComplete )
self . textChanged . connect ( self . setCompleter )
self . listView . clicked . connect ( self . mouseCompleteText )
self . fetchListFinished . connect ( self . showCompleter )
| このpythonコードに誤りはありません。 | code_fix | 4,128 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class BackendTestMixin ( object ) :
urls = [ ]
instance = None
def test_detect ( self ) :
for url in self . urls :
backend = detect_backend ( url [ 0 ] )
self . assertIsInstance ( backend , self . instance )
def test_code ( self ) :
for url in self . urls :
backend = self . instance ( url [ 0 ] )
self . assertEqual ( backend . code , url [ 1 ] )
| このpythonコードに誤りはありません。 | code_fix | 4,129 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def MessageReceived ( self , Message ) :
"str"
pass
| このpythonコードに誤りはありません。 | code_fix | 4,130 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from rest_framework . status import HTTP_503_SERVICE_UNAVAILABLE , HTTP_200_OK
from util . json_request import JsonResponse
| このpythonコードに誤りはありません。 | code_fix | 4,131 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def write ( self , arg , ** kwargs ) :
"str"
if hasattr ( arg , "str" ) :
self . _tofile ( arg , ** kwargs )
else :
with open ( arg , "str" ) as fid :
self . _tofile ( fid , ** kwargs )
| このpythonコードに誤りはありません。 | code_fix | 4,132 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import migrate
import sqlalchemy as sql
from sqlalchemy . engine import reflection
from keystone . common . sql import upgrades
| このpythonコードに誤りはありません。 | code_fix | 4,133 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_y ( self , time ) :
t = time
q = self . ion . q
R_plus = self . R_plus
R_minus = self . R_minus
omega_plus = self . omega_plus
omega_minus = self . omega_minus
phi_plus = self . phi_plus
phi_minus = self . phi_minus
y_t = ( - q / abs ( q ) ) * ( R_plus * sin ( omega_plus * t + phi_plus ) + R_minus * sin ( omega_minus * t + phi_minus ) )
return y_t
| このpythonコードに誤りはありません。 | code_fix | 4,134 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def space_include ( parser , token ) :
"str"
bits = token . split_contents ( )
if len ( bits ) != 2 :
raise TemplateSyntaxError ( _ ( "str" % bits [ 0 ] ) )
path = bits [ 1 ]
return SpaceIncludeNode ( path )
| このpythonコードに誤りはありません。 | code_fix | 4,135 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def validatePage ( self ) :
"str"
generic_effect_selected = self . get_metric ( ) is GENERIC_EFFECT
if generic_effect_selected :
generic_effect_string = METRIC_TEXT_SIMPLE [ GENERIC_EFFECT ]
button_pressed = QMessageBox . question (
self ,
QString ( "str" ) ,
QString ( "str"
"str"
"str"
"str"
"str"
"str" % ( generic_effect_string , generic_effect_string )
) ,
QMessageBox . Yes | QMessageBox . No ,
)
if button_pressed == QMessageBox . No :
return False
return True
| このpythonコードに誤りはありません。 | code_fix | 4,136 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
os . environ [ "str" ] = "str"
from django . conf import settings
import logging
from datetime import *
from autoradio_config import *
from programs . models import Schedule
from programs . models import ScheduleDone
from programs . models import Show
from programs . models import Configure
import mutagen
import os
| このpythonコードに誤りはありません。 | code_fix | 4,137 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , refname , pos , refAllele , altAllele , score ) :
self . refname = refname
self . pos = pos
self . ref = refAllele
self . alt = altAllele
self . score = score
self . alt2score = { }
self . alt2score [ altAllele ] = score
self . totalReads = - 1
| このpythonコードに誤りはありません。 | code_fix | 4,138 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import matplotlib as mpl
mpl . use ( "str" )
import matplotlib . pyplot as plt
from random import randint
from math import *
import numpy as np
from scipy . linalg import expm
from numpy . linalg import solve
from matplotlib import rc
rc ( "str" , ** { "str" : "str" , "str" : [ "str" ] } )
rc ( "str" , usetex = True )
Eye = lambda N : np . matrix ( np . eye ( N ) )
Zeros = lambda Ni , Nj : np . matrix ( np . zeros ( ( Ni , Nj ) ) )
| このpythonコードに誤りはありません。 | code_fix | 4,139 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
__author__ = "str"
import os
import sys
sys . path . insert ( 0 , os . path . join ( "str" , "str" , "str" , "str" , "str" ) )
from adspygoogle import DfpClient
client = DfpClient ( path = os . path . join ( "str" , "str" , "str" , "str" , "str" ) )
user_service = client . GetService ( "str" , version = "str" )
roles = user_service . GetAllRoles ( )
for role in roles :
print ( "str"
% ( role [ "str" ] , role [ "str" ] ) )
| このpythonコードに誤りはありません。 | code_fix | 4,140 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _read_expression_profiles ( logger , pro_file ) :
logger . info ( "str" . format ( f = pro_file ) )
profiles = fs . read_expression_profiles ( pro_file )
profiles . set_index ( fs . PRO_FILE_TRANSCRIPT_ID_COL , inplace = True )
logger . info ( "str" .
format ( n = len ( profiles ) ) )
profiles = profiles [ profiles [ fs . PRO_FILE_NUM_COL ] > 0 ]
logger . info ( "str" .
format ( n = len ( profiles ) ) )
return profiles
| このpythonコードに誤りはありません。 | code_fix | 4,141 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def post ( self , request , domain ) :
record = RepeatRecord . get ( request . POST . get ( "str" ) )
record . fire ( max_tries = 1 , force_send = True )
record . save ( )
return json_response ( {
"str" : record . succeeded ,
"str" : record . failure_reason ,
} )
| このpythonコードに誤りはありません。 | code_fix | 4,142 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_isOwnerYes ( self ) :
"str"
site = None
request = SimpleRequest ( site , "str" , "str" )
request . authzUser = request . authnUser = StubPrincipal ( "str" )
rsrc = CalDAVResource ( )
rsrc . owner = lambda igreq : HRef ( "str" )
self . assertEquals ( ( yield rsrc . isOwner ( request ) ) , True )
| このpythonコードに誤りはありません。 | code_fix | 4,143 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Migration ( migrations . Migration ) :
dependencies = [
( "str" , "str" ) ,
]
operations = [
migrations . AlterField (
model_name = "str" ,
name = "str" ,
field = models . ForeignKey ( null = True , to_field = "str" , to = "str" ) ,
) ,
]
| このpythonコードに誤りはありません。 | code_fix | 4,144 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_context_data ( self , ** kwargs ) :
context = super ( LoveMixin , self ) . get_context_data ( ** kwargs )
context [ "str" ] = self . is_fan ( )
context [ "str" ] = self . get_fan_object ( ) . fans . count ( )
return context
| このpythonコードに誤りはありません。 | code_fix | 4,145 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import platform
import time
import os
import copy
import glob
import datetime
import sys
sys . dont_write_bytecode = True
import numpy as np
import sonde
import matplotlib . pyplot as plt
import pandas
site_description = { "str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" ,
"str" : "str" }
| このpythonコードに誤りはありません。 | code_fix | 4,146 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import datetime
import pytest
from django . utils . timezone import make_naive
from django . core . management import (
call_command ,
find_commands ,
load_command_class ,
)
from django . test import TestCase
import django_peeringdb . models
| このpythonコードに誤りはありません。 | code_fix | 4,147 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def full_name ( self ) :
if self . first_name and self . last_name :
return "str" % ( self . first_name , self . last_name )
| このpythonコードに誤りはありません。 | code_fix | 4,148 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
__version__ = "str"
__author__ = "str"
__all__ = [ ]
from . net import PubSub
| このpythonコードに誤りはありません。 | code_fix | 4,149 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import print_function , division , absolute_import
import os
import io
import bz2
import gzip
from mdtraj . utils . six import PY2 , StringIO
| このpythonコードに誤りはありません。 | code_fix | 4,150 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class ModuleTO ( object ) :
key = unicode_property ( "str" )
label = unicode_property ( "str" )
is_default = bool_property ( "str" , default = False )
@ staticmethod
def fromArray ( obj ) :
m = ModuleTO ( )
m . key = obj [ 0 ]
m . label = obj [ 1 ]
return m
| このpythonコードに誤りはありません。 | code_fix | 4,151 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def vcs_repo ( self , version = LATEST ) :
backend = backend_cls . get ( self . repo_type )
if not backend :
repo = None
else :
proj = VCSProject (
self . name , self . default_branch , self . checkout_path ( version ) , self . clean_repo )
repo = backend ( proj , version )
return repo
| このpythonコードに誤りはありません。 | code_fix | 4,152 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , workspace , vital_parameters ) :
self . workspace = workspace
self . vital_parameters = vital_parameters
self . autoGeneratePrereqs ( )
| このpythonコードに誤りはありません。 | code_fix | 4,153 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from django . shortcuts import render_to_response
from search . models import *
import query
| このpythonコードに誤りはありません。 | code_fix | 4,154 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_arctic_lib ( connection_string , ** kwargs ) :
"str"
from . arctic import Arctic
m = CONNECTION_STR . match ( connection_string )
if not m :
raise ValueError ( "str" % connection_string )
library , host = m . group ( 1 ) , m . group ( 2 )
return _get_arctic ( host , ** kwargs ) [ library ]
| このpythonコードに誤りはありません。 | code_fix | 4,155 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
__author__ = "str"
__email__ = "str"
__version__ = "str"
from twerk import NetworkBuilder
| このpythonコードに誤りはありません。 | code_fix | 4,156 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Select2Widget ( forms . Select ) :
"str"
template_name = "str"
class Media :
js = ( "str" , "str" )
css = { "str" : ( "str" , ) }
| このpythonコードに誤りはありません。 | code_fix | 4,157 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def transparent_rb_click ( self ) :
self . model . transparent_mask = True
self . widget . img_widget . set_color ( [ 255 , 0 , 0 , 100 ] )
self . plot_mask ( )
| このpythonコードに誤りはありません。 | code_fix | 4,158 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from setuptools import setup
install_requires = [
"str"
]
setup ( name = "str" ,
version = "str" ,
description = "str" ,
install_requires = install_requires ,
entry_points = {
"str" :
[ "str" ]
}
)
| このpythonコードに誤りはありません。 | code_fix | 4,159 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
sum = 0
for count in range ( 1 , 1000 ) :
if count % 3 == 0 or count % 5 == 0 :
sum = sum + count
print ( sum )
| このpythonコードに誤りはありません。 | code_fix | 4,160 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
from xlrelease_template_report_maker import XLRJsonFetcher , XLRObjectGraphBuilder , XLRReportBuilder
if __name__ == "str" :
base_url = "str"
template_id = "str"
username = "str"
password = "str"
fetcher = XLRJsonFetcher ( base_url , template_id , username , password )
json_data = fetcher . fetch ( )
builder = XLRObjectGraphBuilder ( json_data )
template = builder . build ( )
report_builder = XLRReportBuilder ( template )
report_builder . build_report ( )
report_builder . save_to_file ( os . path . join ( "str" , "str" ) )
| このpythonコードに誤りはありません。 | code_fix | 4,161 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def register_blueprints ( app = None ) :
"str"
from . controllers . index import index_page
from . api_calls . api_histogram import api_histogram
from . api_calls . api_histogram2d import api_histogram_2d
from . api_calls . api_db_test import api_db_test
app . register_blueprint ( index_page )
app . register_blueprint ( api_histogram )
app . register_blueprint ( api_histogram_2d )
app . register_blueprint ( api_db_test )
| このpythonコードに誤りはありません。 | code_fix | 4,162 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import absolute_import , unicode_literals
from django import forms
from django . contrib . admin . templatetags . admin_static import static
from django . contrib . admin . widgets import AdminTextareaWidget
from django . urls import reverse
from django . utils . translation import ugettext_lazy as _
| このpythonコードに誤りはありません。 | code_fix | 4,163 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def set_weights ( self , weights ) :
"str"
for layer in self . flattened_layers :
nb_param = len ( layer . weights )
layer . set_weights ( weights [ : nb_param ] )
weights = weights [ nb_param : ]
| このpythonコードに誤りはありません。 | code_fix | 4,164 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_create_ratesservice ( self , registry , pool ) :
from adhocracy_core . resources . rate import IRatesService
from substanced . util import find_service
assert registry . content . create ( IRatesService . __identifier__ , parent = pool )
assert find_service ( pool , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,165 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_user_details ( self , response ) :
"str"
name = response . get ( "str" ) or "str"
first_name = "str"
last_name = "str"
if name and "str" in name :
first_name , last_name = response . get ( "str" ) . split ( "str" , 1 )
else :
first_name = name
return { "str" : name ,
"str" : response . get ( "str" ) ,
"str" : name ,
"str" : first_name ,
"str" : last_name }
| このpythonコードに誤りはありません。 | code_fix | 4,166 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Solution ( object ) :
def isIsomorphic ( self , s , t ) :
"str"
return len ( s ) == len ( t ) and len ( set ( zip ( s , t ) ) ) == len ( set ( s ) ) == len ( set ( t ) )
| このpythonコードに誤りはありません。 | code_fix | 4,167 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from datetime import datetime
from django . contrib . contenttypes . models import ContentType
| このpythonコードに誤りはありません。 | code_fix | 4,168 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_init ( ) :
with patch . object ( geopy . geocoders , "str" ) as mock_GoogleV3 :
test_Greengraph = Greengraph ( "str" , "str" )
mock_GoogleV3 . assert_called_with ( domain = "str" )
assert_equal ( test_Greengraph . start , "str" )
assert_equal ( test_Greengraph . end , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,169 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import rdflib
from nose . exc import SkipTest
import unittest
| このpythonコードに誤りはありません。 | code_fix | 4,170 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class UserSerializer ( serializers . HyperlinkedModelSerializer ) :
class Meta :
model = Staff
fields = ( "str" , "str" , "str" , "str" , "str" , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,171 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def _recompute_challenge_users ( self ) :
"str"
for challenge in self . filtered ( lambda c : c . user_domain ) :
current_users = challenge . user_ids
new_users = self . _get_challenger_users ( challenge . user_domain )
if current_users != new_users :
challenge . user_ids = new_users
return True
| このpythonコードに誤りはありません。 | code_fix | 4,172 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def localservices ( ) :
reg = get ( )
appids = { k : v for k , v in dict ( reg . AppIDs ) . iteritems ( ) if v . LocalService is not None }
for g in reg . ClsidsByAppId :
if g . Key in appids :
for c in g :
yield c
| このpythonコードに誤りはありません。 | code_fix | 4,173 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def initialize_options ( self ) :
build_ext . initialize_options ( self )
self . use_cython = False
| このpythonコードに誤りはありません。 | code_fix | 4,174 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
from django . db import models
from app . logic . commandrepo . models . CommandResultModel import CommandResultEntry
| このpythonコードに誤りはありません。 | code_fix | 4,175 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class CommentItem ( ObjectItem ) :
"str"
content = Field ( )
author = Field ( )
published = Field ( )
avatarUrl = Field ( )
parent = Field ( )
| このpythonコードに誤りはありません。 | code_fix | 4,176 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def clean_email ( self ) :
email = self . cleaned_data . get ( "str" )
try :
email = User . objects . get ( email = email )
except User . DoesNotExist :
return email
raise forms . ValidationError ( strLang ( ) [ "str" ] )
| このpythonコードに誤りはありません。 | code_fix | 4,177 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def run_script ( name ) :
ret = subprocess . call ( [
sys . executable ,
os . path . join ( THIS_DIR , name ) ,
] )
if ret != 0 :
raise RutimeError ( )
| このpythonコードに誤りはありません。 | code_fix | 4,178 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
"str"
import socket
ECHO_PORT = 7
sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM )
sock . bind ( ( "str" , ECHO_PORT ) )
while True :
data , address = sock . recvfrom ( 256 )
print ( "str" , address )
sock . sendto ( data , address )
| このpythonコードに誤りはありません。 | code_fix | 4,179 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_404_dog_index ( self ) :
response = self . client . post ( reverse ( "str" , args = [ 3 , ] ) )
self . assertEqual ( response . status_code , 404 )
| このpythonコードに誤りはありません。 | code_fix | 4,180 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
import os
from selenium . webdriver . common . desired_capabilities import DesiredCapabilities
from . base import *
OPTIONAL_APPS = (
"str" ,
PACKAGE_NAME_FILEBROWSER ,
PACKAGE_NAME_GRAPPELLI ,
)
COMPRESS_ENABLED = True
PASSWORD_HASHERS = ( "str" , )
os . environ [ "str" ] = "str"
SELENIUM_SERVER = "str"
SELENIUM_CAPABILITIES = DesiredCapabilities . CHROME . copy ( )
DATABASES = {
"str" : {
"str" : "str" ,
}
}
CACHES = {
"str" : {
"str" : "str" ,
}
}
| このpythonコードに誤りはありません。 | code_fix | 4,181 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Vote ( Serializer ) :
ip_address = fields . StringField ( identifier = True )
name = fields . StringField ( )
date = fields . DateTimeField ( readonly = True )
| このpythonコードに誤りはありません。 | code_fix | 4,182 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from pygments . style import Style
from pygments . token import (
Keyword ,
Name ,
Comment ,
String ,
Error ,
Number ,
Operator ,
Generic ,
Whitespace ,
Punctuation ,
Other ,
Literal ,
)
| このpythonコードに誤りはありません。 | code_fix | 4,183 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def test_provision_instance ( self ) :
"str"
OpenEdXInstanceFactory ( name = "str" )
instance = OpenEdXInstance . objects . get ( )
provision_instance ( instance . pk )
self . assertEqual ( instance . status , "str" )
| このpythonコードに誤りはありません。 | code_fix | 4,184 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from __future__ import absolute_import
VERSION = ( 1 , 2 , 0 )
__version__ = VERSION
__versionstr__ = "str" . join ( map ( str , VERSION ) )
from . client import Elasticsearch
from . transport import Transport
from . connection_pool import ConnectionPool , ConnectionSelector , RoundRobinSelector
from . serializer import JSONSerializer
from . connection import Connection , RequestsHttpConnection , Urllib3HttpConnection , MemcachedConnection , ThriftConnection
| このpythonコードに誤りはありません。 | code_fix | 4,185 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def database_connection ( ) :
parts = urllib . parse . urlparse ( os . environ [ "str" ] )
username = parts . username
password = parts . password
database = parts . path [ 1 : ]
hostname = parts . hostname
return psycopg2 . connect (
database = database ,
user = username ,
password = password ,
host = hostname
)
| このpythonコードに誤りはありません。 | code_fix | 4,186 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def addPythonPackage ( relative_module_path ) :
module_name = "str" . join ( relative_module_path . split ( "str" ) )
template = "str"
return template % ( module_name , relative_module_path )
| このpythonコードに誤りはありません。 | code_fix | 4,187 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class LocationFilter ( GeoFilterSet ) :
contains_properly = GeometryFilter ( name = "str" , lookup_type = "str" )
class Meta :
model = Location
| このpythonコードに誤りはありません。 | code_fix | 4,188 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
n = 10
x = 1
i = 1
while x < 200 :
print ( x , )
x = x + i
i = i + 1
| このpythonコードに誤りはありません。 | code_fix | 4,189 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def slack_im_history ( keys , im_user_id ) :
im_messages = "str"
for key in keys :
api_key = str ( key )
im_history = web . get ( "str" + api_key + "str" + im_user_id +
"str" ) . json ( )
if im_history [ "str" ] is True :
im_messages = im_history [ "str" ]
return im_messages
| このpythonコードに誤りはありません。 | code_fix | 4,190 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
from djpcms . views import appsite , appview
from djpcms . contrib . flowrepo import cms
from djpcms . contrib . flowrepo . models import FlowItem , WebAccount
appurls = (
cms . WebAccountApplication ( "str" , WebAccount ) ,
cms . FlowItemApplication ( "str" , FlowItem , content_names = { cms . Report : "str" } )
)
| このpythonコードに誤りはありません。 | code_fix | 4,191 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def make_dummy_request ( ) :
parsed = urlparse ( settings . SITE_URL )
request = WSGIRequest ( {
"str" : "str" ,
"str" : parsed . scheme ,
"str" : "str" ,
"str" : parsed . hostname ,
"str" : parsed . port or ( 443 if parsed . scheme == "str" else 80 )
} )
return request
| このpythonコードに誤りはありません。 | code_fix | 4,192 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class Harmonogram ( models . Model ) :
program = models . CharField ( "str" , max_length = 200 )
time_start = models . TimeField ( "str" )
time_end = models . TimeField ( "str" , null = True , blank = True )
class Meta :
verbose_name = "str"
verbose_name_plural = "str"
def __str__ ( self ) :
return self . program
| このpythonコードに誤りはありません。 | code_fix | 4,193 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def readdatacommdct ( idfname , iddfile = "str" , commdct = None ) :
"str"
if not commdct :
block , commlst , commdct , idd_index = parse_idd . extractidddata ( iddfile )
theidd = eplusdata . Idd ( block , 2 )
else :
theidd = iddfile
data = eplusdata . Eplusdata ( theidd , idfname )
return data , commdct , idd_index
| このpythonコードに誤りはありません。 | code_fix | 4,194 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def get_default_ui ( self ) :
tc = UI . TabControl ( active = self . _tab )
tc . add ( "str" , self . get_ui_shares ( ) )
tc . add ( "str" , self . get_ui_users ( ) )
tc . add ( "str" , self . get_ui_general ( ) )
return tc
| このpythonコードに誤りはありません。 | code_fix | 4,195 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def __init__ ( self , mmachine ) :
StandardEXT . __init__ ( self , mmachine )
self . name = "str"
self . main_address = "str"
self . main_search_address = "str"
self . chapters_list_type = FORMAT_HTML
self . chapters_type = CHAPTERS_JSON
self . chapters_xpath = "str"
self . image_xpath = "str"
self . new_page_xpath = "str"
self . search_results_xpath = "str"
self . chapters_list_reverse = False
self . search_disabled = True
| このpythonコードに誤りはありません。 | code_fix | 4,196 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def collect ( self , r ) :
p = r [ "str" ] . lower ( )
if self . skip_prefix and p . startswith ( self . skip_prefix ) :
return
if self . skip_suffix and p . endswith ( self . skip_suffix ) :
return
key = "str" . format ( r [ "str" ] . strftime ( "str" ) , r [ "str" ] )
self . counter [ key ] [ "str" . format ( r [ "str" ] ) ] += 1
| このpythonコードに誤りはありません。 | code_fix | 4,197 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
def search_tag_string ( mstring , tag ) :
"str"
if not mstring or len ( mstring ) < 2 :
return False
sval = { }
try :
sval = dict ( e . split ( "str" ) for e in mstring . split ( "str" ) )
except ValueError :
return False
if tag in sval :
return sval [ tag ]
else :
return False
| このpythonコードに誤りはありません。 | code_fix | 4,198 | MIT | bifi | 次に示すpythonコードの誤りを修正しなさい。 |
class NameScoped ( object ) :
"str"
def __init__ ( self , name ) :
self . name = name
def __call__ ( self , f ) :
def runnable ( * args , ** kwargs ) :
with tf . name_scope ( self . name ) :
return f ( * args , ** kwargs )
return runnable
| このpythonコードに誤りはありません。 | code_fix | 4,199 | 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.