code: func calculatePorts(ports []types.HostPortGroupPort) *schema.Set {
  	s := make([]interface{}, 0)
  	for _, port := range ports {
  		m := make(map[string]interface{})
  		m["key"] = port.Key
  		m["mac_addresses"] = structure.SliceStringsToInterfaces(port.Mac)
  		m["type"] = port.Type
  		s = append(s, m)
  	}
  	return schema.NewSet(schema.HashResource(portGroupPortSchema()), s)
  }
docs: // calculatePorts is a utility function that returns a set of port data.