def normalize_mode(mode):
 if (mode is None):
  return None
 if (not isinstance(mode, six.string_types)):
  mode = str(mode)
 return mode.strip('"').strip("'").lstrip('0').zfill(4)

def normalize_mode ( mode ) : if ( mode is None ) : return None if ( not isinstance ( mode , six . string_types ) ) : mode = str ( mode ) return mode . strip ( '"' ) . strip ( "'" ) . lstrip ( '0' ) . zfill ( 4 )
return a mode value .