code: def node_applications(self, state=None, user=None):
          
          path = '/ws/v1/node/apps'
  
          legal_states = set([s for s, _ in ApplicationState])
          if state is not None and state not in legal_states:
              msg = 'Application State %s is illegal' % (state,)
              raise IllegalArgumentError(msg)
  
          loc_args = (
              ('state', state),
              ('user', user))
  
          params = self.construct_parameters(loc_args)
  
          return self.request(path, **params)
docs: 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