Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4155d8bb
提交
4155d8bb
authored
6月 05, 2013
作者:
Gabe Schwartz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replaced plain StringIO with the one from six.py.
StringIO was moved in python 3.
上级
2febf197
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
59 行增加
和
62 行删除
+59
-62
debugmode.py
theano/compile/debugmode.py
+1
-1
test_module.py
theano/compile/tests/test_module.py
+3
-2
configparser.py
theano/configparser.py
+2
-2
cc.py
theano/gof/cc.py
+2
-2
cmodule.py
theano/gof/cmodule.py
+2
-2
opt.py
theano/gof/opt.py
+3
-3
optdb.py
theano/gof/optdb.py
+2
-2
check_whitespace.py
theano/misc/hooks/check_whitespace.py
+1
-1
printing.py
theano/printing.py
+2
-2
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+6
-6
blas.py
theano/sandbox/cuda/blas.py
+4
-4
elemwise.py
theano/sandbox/cuda/elemwise.py
+8
-7
nnet.py
theano/sandbox/cuda/nnet.py
+2
-2
type.py
theano/sandbox/cuda/type.py
+2
-2
opt.py
theano/tensor/opt.py
+2
-3
test_basic.py
theano/tensor/tests/test_basic.py
+5
-5
test_naacl09.py
theano/tensor/tests/test_naacl09.py
+2
-2
test_opt.py
theano/tensor/tests/test_opt.py
+2
-2
test_determinism.py
theano/tests/test_determinism.py
+1
-2
test_printing.py
theano/tests/test_printing.py
+7
-10
没有找到文件。
theano/compile/debugmode.py
浏览文件 @
4155d8bb
...
...
@@ -7,13 +7,13 @@ __docformat__ = "restructuredtext en"
import
copy
,
sys
,
copy_reg
,
gc
from
itertools
import
izip
from
StringIO
import
StringIO
import
numpy
import
theano
from
theano
import
gof
from
theano.compat
import
get_unbound_function
from
theano.compat.six
import
StringIO
from
theano.gof
import
FunctionGraph
,
graph
,
utils
,
link
,
ops_with_inner_function
from
theano.gof.link
import
raise_with_op
from
theano.gof.cc
import
CLinker
...
...
theano/compile/tests/test_module.py
浏览文件 @
4155d8bb
...
...
@@ -720,9 +720,10 @@ def test_pickle_aliased_memory():
m
.
x
[
0
,
0
]
=
3.14
assert
m
.
y
[
0
,
0
]
==
3.14
import
StringIO
,
logging
import
logging
from
theano.compat.six
import
StringIO
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
handler
=
logging
.
StreamHandler
(
sio
)
logging
.
getLogger
(
'theano.compile.function_module'
)
.
addHandler
(
handler
)
# Silence original handler when intentionnally generating warning messages
...
...
theano/configparser.py
浏览文件 @
4155d8bb
...
...
@@ -7,7 +7,7 @@ import os
import
sys
import
warnings
import
StringIO
from
theano.compat.six
import
StringIO
import
theano
from
theano.compat
import
configparser
as
ConfigParser
...
...
@@ -150,7 +150,7 @@ class TheanoConfigParser(object):
_i_am_a_config_class
=
True
def
__str__
(
self
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
_config_print
(
self
.
__class__
,
sio
)
return
sio
.
getvalue
()
...
...
theano/gof/cc.py
浏览文件 @
4155d8bb
...
...
@@ -5,13 +5,13 @@ Defines Linkers that deal with C implementations.
# Python imports
from
copy
import
copy
import
os
import
StringIO
import
sys
from
itertools
import
izip
import
numpy
from
theano.compat
import
PY3
from
theano.compat.six
import
StringIO
if
PY3
:
import
hashlib
...
...
@@ -1320,7 +1320,7 @@ class CLinker(link.Linker):
return
ret
def
instantiate_code
(
self
,
n_args
):
code
=
StringIO
.
StringIO
()
code
=
StringIO
()
struct_name
=
self
.
struct_name
print
>>
code
,
"static PyObject * instantiate(PyObject * self, PyObject *argtuple) {"
print
>>
code
,
' assert(PyTuple_Check(argtuple));'
...
...
theano/gof/cmodule.py
浏览文件 @
4155d8bb
...
...
@@ -8,7 +8,6 @@ import os
import
re
import
shutil
import
stat
import
StringIO
import
subprocess
import
sys
import
tempfile
...
...
@@ -21,6 +20,7 @@ import numpy.distutils # TODO: TensorType should handle this
import
theano
from
theano.compat
import
PY3
,
next
,
decode
,
decode_iter
from
theano.compat.six
import
StringIO
from
theano.gof.utils
import
flatten
from
theano.configparser
import
config
from
theano.gof.cc
import
hash_from_code
...
...
@@ -196,7 +196,7 @@ static struct PyModuleDef moduledef = {{
self
.
functions
.
append
(
fn
)
def
code
(
self
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
for
inc
in
self
.
includes
:
if
not
inc
:
continue
...
...
theano/gof/opt.py
浏览文件 @
4155d8bb
...
...
@@ -274,7 +274,7 @@ class SeqOptimizer(Optimizer, list):
new_sub_profile
.
append
(
None
)
# merge not common opt
import
StringIO
from
theano.compat.six
import
StringIO
for
l
in
set
(
prof1
[
0
])
.
symmetric_difference
(
set
(
prof2
[
0
])):
#The set trick above only work for the same object optimization
#It don't work for equivalent optimization.
...
...
@@ -282,8 +282,8 @@ class SeqOptimizer(Optimizer, list):
new_l_names
=
[
o
.
name
for
o
in
new_l
]
if
l
.
name
in
new_l_names
:
idx
=
new_l_names
.
index
(
l
.
name
)
io1
=
StringIO
.
StringIO
()
io2
=
StringIO
.
StringIO
()
io1
=
StringIO
()
io2
=
StringIO
()
l
.
print_summary
(
io1
)
new_l
[
idx
]
.
print_summary
(
io2
)
if
io1
.
read
()
==
io2
.
read
():
...
...
theano/gof/optdb.py
浏览文件 @
4155d8bb
import
StringIO
import
sys
from
theano.gof.python25
import
DefaultOrderedDict
import
numpy
from
theano.compat.six
import
StringIO
from
theano.gof
import
opt
from
theano.configparser
import
AddConfigVar
,
FloatParam
from
theano
import
config
...
...
@@ -258,7 +258,7 @@ class SequenceDB(DB):
print
>>
stream
,
" db"
,
self
.
__db__
def
__str__
(
self
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
self
.
print_summary
(
sio
)
return
sio
.
getvalue
()
...
...
theano/misc/hooks/check_whitespace.py
浏览文件 @
4155d8bb
...
...
@@ -5,7 +5,6 @@ import difflib
import
operator
import
os
import
string
from
StringIO
import
StringIO
from
subprocess
import
Popen
,
PIPE
import
sys
import
tabnanny
...
...
@@ -13,6 +12,7 @@ import tokenize
import
argparse
import
reindent
from
theano.compat.six.StringIO
import
StringIO
SKIP_WHITESPACE_CHECK_FILENAME
=
".hg/skip_whitespace_check"
...
...
theano/printing.py
浏览文件 @
4155d8bb
...
...
@@ -6,7 +6,6 @@ in a graph(Print Op)
from
copy
import
copy
import
logging
import
os
import
StringIO
import
sys
# Not available on all platforms
hashlib
=
None
...
...
@@ -26,6 +25,7 @@ except ImportError:
import
theano
from
theano
import
gof
from
theano
import
config
from
theano.compat.six
import
StringIO
from
theano.gof
import
Op
,
Apply
from
theano.gof.python25
import
any
from
theano.compile
import
Function
,
debugmode
...
...
@@ -74,7 +74,7 @@ def debugprint(obj, depth=-1, print_type=False,
"""
if
file
==
'str'
:
_file
=
StringIO
.
StringIO
()
_file
=
StringIO
()
elif
file
is
None
:
_file
=
sys
.
stdout
else
:
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
4155d8bb
import
copy
import
logging
import
StringIO
import
sys
import
numpy
...
...
@@ -8,6 +7,7 @@ import numpy
import
theano
from
theano
import
Op
,
Type
,
Apply
,
Variable
,
Constant
from
theano
import
tensor
,
scalar
,
config
from
theano.compat.six
import
StringIO
from
theano.scalar
import
Scalar
scal
=
scalar
# somewhere scalar gets reassigned to be a function
...
...
@@ -385,7 +385,7 @@ class GpuDimShuffle(GpuOp):
nd_in
=
len
(
self
.
input_broadcastable
)
nd_out
=
len
(
self
.
new_order
)
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
fail
=
sub
[
'fail'
]
#check input
...
...
@@ -618,7 +618,7 @@ class GpuCAReduce(GpuOp):
assert
nd_in
-
nd_out
==
sum
(
self
.
reduce_mask
)
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
fail
=
sub
[
'fail'
]
#check input
...
...
@@ -750,7 +750,7 @@ class GpuCAReduce(GpuOp):
%(fail)
s;
}
"""
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
if
pattern
is
None
:
pattern
=
''
.
join
(
str
(
c
)
for
c
in
self
.
reduce_mask
)
ndim
=
len
(
self
.
reduce_mask
)
...
...
@@ -843,7 +843,7 @@ class GpuCAReduce(GpuOp):
ndim
=
len
(
reduce_mask
)
if
pattern
is
None
:
pattern
=
''
.
join
(
str
(
i
)
for
i
in
reduce_mask
)
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
static __global__ void kernel_reduce_
%(pattern)
s_
%(nodename)
s(
...
...
@@ -1590,7 +1590,7 @@ class GpuCAReduce(GpuOp):
raise
NotImplementedError
()
def
c_support_code_apply
(
self
,
node
,
nodename
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
nd_in
=
len
(
self
.
reduce_mask
)
if
all
(
i
==
1
for
i
in
self
.
reduce_mask
):
self
.
_op_guard
()
...
...
theano/sandbox/cuda/blas.py
浏览文件 @
4155d8bb
import
copy
import
os
import
StringIO
import
theano
from
theano
import
Apply
from
theano
import
tensor
from
theano.compat.six
import
StringIO
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda
import
GpuOp
...
...
@@ -226,7 +226,7 @@ class GpuGemm(GpuOp):
z_out
,
=
outputs
inplace
=
int
(
self
.
inplace
)
fail
=
sub
[
'fail'
]
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
...
...
@@ -341,7 +341,7 @@ class GpuGemv(GpuOp):
z_out
,
=
outputs
inplace
=
int
(
self
.
inplace
)
fail
=
sub
[
'fail'
]
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
float
%(name)
s_alpha = ((dtype_
%(a)
s*)(
%(a)
s->data))[0];
...
...
@@ -438,7 +438,7 @@ class GpuGer(GpuOp):
z_out
,
=
outputs
inplace
=
int
(
self
.
inplace
)
fail
=
sub
[
'fail'
]
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
float
%(name)
s_alpha = ((dtype_
%(a)
s*)(
%(a)
s->data))[0];
...
...
theano/sandbox/cuda/elemwise.py
浏览文件 @
4155d8bb
...
...
@@ -5,12 +5,13 @@ The elemwise fct are also used with scalar operation! So it can happen that ndim
"""
import
copy
,
logging
,
StringIO
,
sys
import
copy
,
logging
,
sys
import
numpy
from
theano.scalar.basic
import
upgrade_to_float_no_complex
,
complex_types
from
theano.scalar.basic_scipy
import
Erfinv
from
theano.compat.six
import
StringIO
from
theano
import
Apply
,
Constant
,
Op
,
Type
,
Variable
from
theano
import
gof
,
scalar
,
tensor
...
...
@@ -65,7 +66,7 @@ class NaiveAlgo(object):
self
.
inplace_pattern
=
inplace_pattern
def
c_src_kernel
(
self
,
node
,
nodename
,
nd
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
#print 'C_SRC_KERNEL', sio.getvalue()
for
ipos
,
i
in
enumerate
(
node
.
inputs
):
...
...
@@ -166,7 +167,7 @@ class NaiveAlgo(object):
"""
nd
=
node
.
outputs
[
0
]
.
type
.
ndim
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
#print 'C_SRC_KERNEL', sio.getvalue()
if
nd
in
(
4
,):
...
...
@@ -267,7 +268,7 @@ class NaiveAlgo(object):
nd
=
node
.
outputs
[
0
]
.
type
.
ndim
n_in
=
len
(
node
.
inputs
)
n_out
=
len
(
node
.
outputs
)
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
if
nd
not
in
(
2
,):
return
sio
.
getvalue
()
...
...
@@ -418,7 +419,7 @@ class NaiveAlgo(object):
def
c_src_kernel_Ccontiguous
(
self
,
node
,
nodename
):
nd
=
node
.
outputs
[
0
]
.
type
.
ndim
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
#print 'C_SRC_KERNEL', sio.getvalue()
for
ipos
,
i
in
enumerate
(
node
.
inputs
):
...
...
@@ -503,7 +504,7 @@ class NaiveAlgo(object):
scalar_op
=
self
.
scalar_op
.
__class__
.
__name__
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
static void can_collapse_
%(nodename)
s(int nd, const int * dims, const int * strides, int collapse[])
{
...
...
@@ -856,7 +857,7 @@ nd_collapse_[i]=0;
d
=
dict
(
sub
)
nd
=
node
.
outputs
[
0
]
.
type
.
ndim
d
.
update
(
locals
())
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
nin
=
len
(
inputs
)
nout
=
len
(
outputs
)
fail
=
sub
[
'fail'
]
...
...
theano/sandbox/cuda/nnet.py
浏览文件 @
4155d8bb
from
theano
import
Op
,
Apply
import
StringIO
from
theano.compat.six
import
StringIO
from
theano.sandbox.cuda
import
GpuOp
...
...
@@ -92,7 +92,7 @@ class GpuCrossentropySoftmaxArgmax1HotWithBias (GpuOp):
nll
,
sm
,
am
=
out
classname
=
self
.
__class__
.
__name__
fail
=
sub
[
'fail'
]
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
print
>>
sio
,
"""
if (
%(y_idx)
s->nd != 1)
{
...
...
theano/sandbox/cuda/type.py
浏览文件 @
4155d8bb
"""Provide CudaNdarrayType
"""
import
os
import
StringIO
import
copy_reg
import
numpy
...
...
@@ -10,6 +9,7 @@ import theano
from
theano
import
Type
,
Variable
from
theano
import
tensor
,
config
from
theano
import
scalar
as
scal
from
theano.compat.six
import
StringIO
try
:
# We must do those import to be able to create the full doc when nvcc
...
...
@@ -274,7 +274,7 @@ class CudaNdarrayType(Type):
return
"
%(name)
s = NULL;"
%
locals
()
def
c_extract
(
self
,
name
,
sub
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
fail
=
sub
[
'fail'
]
nd
=
self
.
ndim
print
>>
sio
,
"""
...
...
theano/tensor/opt.py
浏览文件 @
4155d8bb
...
...
@@ -9,7 +9,6 @@ _logger = logging.getLogger('theano.tensor.opt')
import
operator
import
itertools
import
StringIO
import
sys
import
traceback
from
itertools
import
izip
...
...
@@ -35,7 +34,7 @@ from theano.gof.opt import (Optimizer, pre_constant_merge,
from
theano.gof.opt
import
merge_optimizer
from
theano.gof
import
toolbox
,
DestroyHandler
from
theano.tensor.basic
import
get_scalar_constant_value
,
ShapeError
,
NotScalarConstantError
from
theano.compat.six
import
StringIO
theano
.
configparser
.
AddConfigVar
(
'on_shape_error'
,
"warn: print a warning and use the default"
...
...
@@ -836,7 +835,7 @@ class ShapeFeature(object):
raise
TypeError
(
'shapes must be tuple/list'
,
(
r
,
s
))
if
r
.
ndim
!=
len
(
s
):
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
theano
.
printing
.
debugprint
(
r
,
file
=
sio
,
print_type
=
True
)
raise
AssertionError
(
"Something inferred a shape with
%
d dimensions "
...
...
theano/tensor/tests/test_basic.py
浏览文件 @
4155d8bb
...
...
@@ -2,7 +2,6 @@ import itertools
import
logging
import
operator
import
os
import
StringIO
import
sys
from
tempfile
import
mkstemp
import
unittest
...
...
@@ -20,6 +19,7 @@ from numpy.testing.noseclasses import KnownFailureTest
import
theano
from
theano.compat
import
PY3
,
exc_message
,
operator_div
from
theano.compat.six
import
StringIO
from
theano
import
compile
,
config
,
function
,
gof
,
tensor
,
shared
from
theano.compile
import
DeepCopyOp
from
theano.compile.mode
import
get_default_mode
...
...
@@ -2269,7 +2269,7 @@ class T_max_and_argmax(unittest.TestCase):
def
test2_invalid_neg
(
self
):
n
=
as_tensor_variable
(
rand
(
2
,
3
))
old_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
.
StringIO
()
sys
.
stderr
=
StringIO
()
try
:
try
:
eval_outputs
(
max_and_argmax
(
n
,
-
3
))
...
...
@@ -2463,7 +2463,7 @@ class T_argmin_argmax(unittest.TestCase):
for
fct
,
nfct
in
[(
argmax
,
numpy
.
argmax
),
(
argmin
,
numpy
.
argmin
)]:
n
=
as_tensor_variable
(
rand
(
2
,
3
))
old_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
.
StringIO
()
sys
.
stderr
=
StringIO
()
try
:
try
:
eval_outputs
(
fct
(
n
,
-
3
))
...
...
@@ -2596,7 +2596,7 @@ class T_min_max(unittest.TestCase):
for
fct
in
[
max
,
min
]:
n
=
as_tensor_variable
(
rand
(
2
,
3
))
old_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
.
StringIO
()
sys
.
stderr
=
StringIO
()
try
:
try
:
eval_outputs
(
fct
(
n
,
-
3
))
...
...
@@ -2931,7 +2931,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
t
=
n
[
4
:
5
,
3
]
self
.
assertTrue
(
isinstance
(
t
.
owner
.
op
,
Subtensor
))
old_stderr
=
sys
.
stderr
sys
.
stderr
=
StringIO
.
StringIO
()
sys
.
stderr
=
StringIO
()
try
:
self
.
assertRaises
(
IndexError
,
self
.
eval_output_and_check
,
[
t
])
...
...
theano/tensor/tests/test_naacl09.py
浏览文件 @
4155d8bb
...
...
@@ -652,10 +652,10 @@ def profile_main():
# We've renamed our original main() above to real_main()
import
cProfile
import
pstats
import
StringIO
from
theano.compat.six
import
StringIO
prof
=
cProfile
.
Profile
()
prof
=
prof
.
runctx
(
"real_main()"
,
globals
(),
locals
())
stream
=
StringIO
.
StringIO
()
stream
=
StringIO
()
stats
=
pstats
.
Stats
(
prof
)
stats
.
sort_stats
(
"time"
)
# Or cumulative
stats
.
print_stats
(
80
)
# 80 = how many to print
...
...
theano/tensor/tests/test_opt.py
浏览文件 @
4155d8bb
...
...
@@ -2,7 +2,6 @@
import
copy
import
logging
import
StringIO
import
time
import
unittest
...
...
@@ -13,6 +12,7 @@ from numpy.testing.noseclasses import KnownFailureTest
import
theano
import
theano.scalar
as
scal
from
theano.compat.six
import
StringIO
from
theano
import
compile
from
theano.compile
import
deep_copy_op
,
DeepCopyOp
from
theano
import
config
...
...
@@ -742,7 +742,7 @@ class test_canonize(unittest.TestCase):
This bug caused an infinite loop which was caught by the equilibrium
optimizer, resulting in an error log message.
"""
sio
=
StringIO
.
StringIO
()
sio
=
StringIO
()
handler
=
logging
.
StreamHandler
(
sio
)
handler
.
setLevel
(
logging
.
ERROR
)
logging
.
getLogger
(
'theano.gof.opt'
)
.
addHandler
(
handler
)
...
...
theano/tests/test_determinism.py
浏览文件 @
4155d8bb
...
...
@@ -5,12 +5,11 @@ from theano.tests import disturb_mem
import
numpy
as
np
import
theano
from
theano.printing
import
var_descriptor
from
cStringIO
import
StringIO
from
nose.plugins.skip
import
SkipTest
from
theano
import
config
from
theano
import
shared
from
theano.compat.six
import
StringIO
def
sharedX
(
x
,
name
=
None
):
x
=
np
.
cast
[
config
.
floatX
](
x
)
...
...
theano/tests/test_printing.py
浏览文件 @
4155d8bb
"""
Tests of printing functionality
"""
import
logging
import
StringIO
from
nose.plugins.skip
import
SkipTest
...
...
@@ -12,7 +9,7 @@ import theano
import
theano.tensor
as
tensor
from
theano.printing
import
min_informative_str
,
debugprint
from
theano.compat.six
import
StringIO
def
test_pydotprint_cond_highlight
():
"""
...
...
@@ -29,7 +26,7 @@ def test_pydotprint_cond_highlight():
f
=
theano
.
function
([
x
],
x
*
2
)
f
([
1
,
2
,
3
,
4
])
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
new_handler
=
logging
.
StreamHandler
(
s
)
new_handler
.
setLevel
(
logging
.
DEBUG
)
orig_handler
=
theano
.
logging_default_handler
...
...
@@ -65,7 +62,7 @@ def test_pydotprint_long_name():
f
=
theano
.
function
([
x
],
[
x
*
2
,
x
+
x
],
mode
=
mode
)
f
([
1
,
2
,
3
,
4
])
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
new_handler
=
logging
.
StreamHandler
(
s
)
new_handler
.
setLevel
(
logging
.
DEBUG
)
orig_handler
=
theano
.
logging_default_handler
...
...
@@ -131,7 +128,7 @@ def test_debugprint():
debugprint
(
G
)
# test ids=int
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
debugprint
(
G
,
file
=
s
,
ids
=
'int'
)
s
=
s
.
getvalue
()
# The additional white space are needed!
...
...
@@ -151,7 +148,7 @@ def test_debugprint():
assert
s
==
reference
# test ids=CHAR
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
debugprint
(
G
,
file
=
s
,
ids
=
'CHAR'
)
s
=
s
.
getvalue
()
# The additional white space are needed!
...
...
@@ -171,7 +168,7 @@ def test_debugprint():
assert
s
==
reference
# test ids=CHAR, stop_on_name=True
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
debugprint
(
G
,
file
=
s
,
ids
=
'CHAR'
,
stop_on_name
=
True
)
s
=
s
.
getvalue
()
# The additional white space are needed!
...
...
@@ -189,7 +186,7 @@ def test_debugprint():
assert
s
==
reference
# test ids=
s
=
StringIO
.
StringIO
()
s
=
StringIO
()
debugprint
(
G
,
file
=
s
,
ids
=
''
)
s
=
s
.
getvalue
()
# The additional white space are needed!
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论