def is_effective_user(user_id_or_name):
 euid = os.geteuid()
 if (str(user_id_or_name) == str(euid)):
  return True
 effective_user_name = pwd.getpwuid(euid).pw_name
 return (user_id_or_name == effective_user_name)

def is_effective_user ( user_id_or_name ) : euid = os . geteuid ( ) if ( str ( user_id_or_name ) == str ( euid ) ) : return True effective_user_name = pwd . getpwuid ( euid ) . pw_name return ( user_id_or_name == effective_user_name )
returns true if user_id_or_name is effective user .