code: def summary_by_datacenter(self):
          
          datacenters = collections.defaultdict(lambda: {
              'hardware_count': 0,
              'public_ip_count': 0,
              'subnet_count': 0,
              'virtual_guest_count': 0,
              'vlan_count': 0,
          })
  
          for vlan in self.list_vlans():
              name = utils.lookup(vlan, 'primaryRouter', 'datacenter', 'name')
  
              datacenters[name]['vlan_count'] += 1
              datacenters[name]['public_ip_count'] += (
                  vlan['totalPrimaryIpAddressCount'])
              datacenters[name]['subnet_count'] += vlan['subnetCount']
  
              # NOTE(kmcdonald): Only count hardware/guests once
              if vlan.get('networkSpace') == 'PRIVATE':
                  datacenters[name]['hardware_count'] += (
                      vlan['hardwareCount'])
                  datacenters[name]['virtual_guest_count'] += (
                      vlan['virtualGuestCount'])
  
          return dict(datacenters)
docs: Summary of the networks on the account, grouped by data center.
  
          The resultant dictionary is primarily useful for statistical purposes.
          It contains count information rather than raw data. If you want raw
          information, see the :func:`list_vlans` method instead.
  
          :returns: A dictionary keyed by data center with the data containing a
                    set of counts for subnets, hardware, virtual servers, and
                    other objects residing within that data center.