def stat_mode_to_index_mode(mode):
 if S_ISLNK(mode):
  return S_IFLNK
 if (S_ISDIR(mode) or (S_IFMT(mode) == S_IFGITLINK)):
  return S_IFGITLINK
 return ((S_IFREG | 420) | (mode & 73))

def stat_mode_to_index_mode ( mode ) : if S_ISLNK ( mode ) : return S_IFLNK if ( S_ISDIR ( mode ) or ( S_IFMT ( mode ) == S_IFGITLINK ) ) : return S_IFGITLINK return ( ( S_IFREG | 420 ) | ( mode & 73 ) )
convert the given mode from a stat call to the corresponding index mode and return it .