#NEWLINE# def manage_mode( mode ) : #NEWLINE# #INDENT# "\n    Return a mode value, normalized to a string\n\n    CLI Example:\n\n    .. code-block:: bash\n\n        salt '*' config.manage_mode\n    " #NEWLINE# if ( mode is None ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( not isinstance ( mode , six . string_types ) ) : #NEWLINE# #INDENT# mode = str ( mode ) #NEWLINE# #UNINDENT# ret = mode . strip ( '"' ) . strip ( "'" ) . lstrip ( '0' ) . zfill ( 4 ) #NEWLINE# if ( ret [ 0 ] != '0' ) : #NEWLINE# #INDENT# return '0{0}' . format ( ret ) #NEWLINE# #UNINDENT# return ret