def is_authenticated_with_proxy(proxy):
if proxy is None:<EOL><INDENT>return False<EOL><DEDENT>elif proxy.has_authentication():<EOL><INDENT>return proxy.get_authentication().is_valid()<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Given a Proxy, checks whether a user is authenticated