def get_effective_agent_id_with_proxy(proxy):
if is_authenticated_with_proxy(proxy):<EOL><INDENT>if proxy.has_effective_agent():<EOL><INDENT>return proxy.get_effective_agent_id()<EOL><DEDENT>else:<EOL><INDENT>return proxy.get_authentication().get_agent_id()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>return Id(<EOL>identifier='<STR_LIT>',<EOL>namespace='<STR_LIT>',<EOL>authority='<STR_LIT>')<EOL><DEDENT>
Given a Proxy, returns the Id of the effective Agent