code: def resources(self):
          ''' get total resources and available ones '''
          used_resources = self._used_resources()
          ret = collections.defaultdict(dict)
          for resource, total in six.iteritems(self._resources):
              ret[resource]['total'] = total
              if resource in used_resources:
                  ret[resource]['used'] = used_resources[resource]
              else:
                  ret[resource]['used'] = 0
          return ref resources(self):
          ''' get total resources and available ones '''
          used_resources = self._used_resources()
          ret = collections.defaultdict(dict)
          for resource, total in six.iteritems(self._resources):
              ret[resource]['total'] = total
              if resource in used_resources:
                  ret[resource]['used'] = used_resources[resource]
              else:
                  ret[resource]['used'] = 0
          return ret
docs: get total resources and available ones