code: def _get_resources(rtype='resources'):
      
      cpus = 0
      mem = 0
      summary = DCOSClient().get_state_summary()
  
      if 'slaves' in summary:
          agents = summary.get('slaves')
          for agent in agents:
              if agent[rtype].get('cpus') is not None:
                  cpus += agent[rtype].get('cpus')
              if agent[rtype].get('mem') is not None:
                  mem += agent[rtype].get('mem')
  
      return Resources(cpus, mem)
docs: resource types from state summary include:  resources, used_resources
      offered_resources, reserved_resources, unreserved_resources
      The default is resources.
  
      :param rtype: the type of resources to return
      :type rtype: str
      :param role: the name of the role if for reserved and if None all reserved
      :type rtype: str
  
      :return: resources(cpu,mem)
      :rtype: Resources