#NEWLINE# def ones( r , c = None ) : #NEWLINE# #INDENT# 'Returns a matrix of ones with ``r`` rows and ``c`` columns;\n    if ``c`` is omitted a square matrix will be returned.\n\n    See Also\n    ========\n\n    zeros\n    eye\n    diag\n    ' #NEWLINE# from . dense import Matrix #NEWLINE# c = ( r if ( c is None ) else c ) #NEWLINE# r = as_int ( r ) #NEWLINE# c = as_int ( c ) #NEWLINE# return Matrix ( r , c , ( ( [ S . One ] * c ) * c ) )