def key_entry(entry):
 (name, value) = entry
 if stat.S_ISDIR(value[0]):
  name += '/'
 return name

def key_entry ( entry ) : ( name , value ) = entry if stat . S_ISDIR ( value [ 0 ] ) : name += '/' return name
sort key for tree entry .