#NEWLINE# def crop( * args , **kwargs ) : #NEWLINE# #INDENT# "\n    Inlinefunc. Crops ingoing text to given widths.\n\n    Args:\n        text (str, optional): Text to crop.\n        width (str, optional): Will be converted to an integer. Width of\n            crop in characters.\n        suffix (str, optional): End string to mark the fact that a part\n            of the string was cropped. Defaults to `[...]`.\n    Kwargs:\n        session (Session): Session performing the crop.\n\n    Example:\n        `$crop(text, width=78, suffix='[...]')`\n\n    " #NEWLINE# ( text , width , suffix ) = ( '' , 78 , '[...]' ) #NEWLINE# nargs = len ( suffix ) #NEWLINE# if ( nargs > 0 ) : #NEWLINE# #INDENT# text = args [ 0 ] #NEWLINE# #UNINDENT# if ( nargs > 1 ) : #NEWLINE# #INDENT# width = ( int ( args [ 1 ] ) if args [ 1 ] . strip ( ) . isdigit ( ) else 78 ) #NEWLINE# #UNINDENT# if ( nargs > 2 ) : #NEWLINE# #INDENT# suffix = args [ 2 ] #NEWLINE# #UNINDENT# return utils . crop ( text , width = width , suffix = suffix )