def parse_uid(uid):
 try:
  return int(uid)
 except ValueError:
  if pwd:
   try:
    return pwd.getpwnam(uid).pw_uid
   except KeyError:
    raise KeyError(('User does not exist: %r' % (uid,)))
  raise

def parse_uid ( uid ) : try : return int ( uid ) except ValueError : if pwd : try : return pwd . getpwnam ( uid ) . pw_uid except KeyError : raise KeyError ( ( 'User does not exist: %r' % ( uid , ) ) ) raise
parse user id .