def canonicalize_name(name):
 if ((not name) or (name == SEP)):
  return name
 elif (name[0] == SEP):
  return ('/' + '/'.join([x for x in name.split(SEP) if x]))
 else:
  return '/'.join([x for x in name.split(SEP) if x])

def canonicalize_name ( name ) : if ( ( not name ) or ( name == SEP ) ) : return name elif ( name [ 0 ] == SEP ) : return ( '/' + '/' . join ( [ x for x in name . split ( SEP ) if x ] ) ) else : return '/' . join ( [ x for x in name . split ( SEP ) if x ] )
put name in canonical form .