code: def get_reserved_resources(role=None):
      
      rtype = 'reserved_resources'
      cpus = 0.0
      mem = 0.0
      summary = DCOSClient().get_state_summary()
  
      if 'slaves' in summary:
          agents = summary.get('slaves')
          for agent in agents:
              resource_reservations = agent.get(rtype)
              reservations = []
              if role is None or '*' in role:
                  reservations = resource_reservations.values()
              elif role in resource_reservations:
                  reservations = [resource_reservations.get(role)]
              for reservation in reservations:
                  if reservation.get('cpus') is not None:
                      cpus += reservation.get('cpus')
                  if reservation.get('mem') is not None:
                      mem += reservation.get('mem')
  
      return Resources(cpus, mem)
docs: resource types from state summary include: reserved_resources
  
      :param role: the name of the role if for reserved and if None all reserved
      :type role: str
  
      :return: resources(cpu,mem)
      :rtype: Resources