def node_applications(self, state=None, user=None):
path = '<STR_LIT>'<EOL>legal_states = set([s for s, _ in ApplicationState])<EOL>if state is not None and state not in legal_states:<EOL><INDENT>msg = '<STR_LIT>' % (state,)<EOL>raise IllegalArgumentError(msg)<EOL><DEDENT>loc_args = (<EOL>('<STR_LIT:state>', state),<EOL>('<STR_LIT:user>', user))<EOL>params = self.construct_parameters(loc_args)<EOL>return self.request(path, **params)<EOL>
With the Applications API, you can obtain a collection of resources,
each of which represents an application.

:param str state: application state
:param str user: user name
:returns: API response object with JSON data
:rtype: :py:class:`yarn_api_client.base.Response`
:raises yarn_api_client.errors.IllegalArgumentError: if `state`
    incorrect