def __init__(self, credentials):
super(_IAMAuthHandler, self).__init__()<EOL>self._credentials = credentials<EOL>self._api_key = self._credentials[_IAMConstants.API_KEY]<EOL>v2url = self._credentials[_IAMConstants.V2_REST_URL]<EOL>v2host = parse.urlparse(v2url).hostname<EOL>if v2host.endswith('<STR_LIT>') or ('<STR_LIT>' in v2host and v2host.endswith('<STR_LIT>')):<EOL><INDENT>self._token_url = _IAMConstants.TOKEN_URL_TEST<EOL><DEDENT>else:<EOL><INDENT>self._token_url = _IAMConstants.TOKEN_URL<EOL><DEDENT>
Args:
    credentials: The credentials of the Streaming Analytics service.