#NEWLINE# def matrix_eye( n , **options ) : #NEWLINE# #INDENT# 'Get the version of eye and tensor_product for a given format.' #NEWLINE# format = options . get ( 'format' , 'sympy' ) #NEWLINE# if ( format == 'sympy' ) : #NEWLINE# #INDENT# return eye ( n ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( format == 'numpy' ) : #NEWLINE# #INDENT# return _numpy_eye ( n ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( format == 'scipy.sparse' ) : #NEWLINE# #INDENT# return _scipy_sparse_eye ( n ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# raise NotImplementedError ( ( 'Invalid format: %r' % format ) )