def normalize_data(vms, vm_statuses, nics, public_ips):
    """
    Normalize the data from a series of Azure cloud API calls into
    a Python dict object containing very specific portions of the original data.

    dict = { '<instance_name>': { 'public_ip': '<public_ip>', 'public_dns_name': '<public_dns_name>',
        'status': '<Up|Down>', 'source': 'Azure' }
    }
    """
    normalized_data = {}
    for vm_id in vms:
        vm_data = vms[vm_id]
        name = vm_data['name']
        nic_id = vm_data['nic_id']
        nic_data = nics[nic_id]
        public_ip_id = nic_data['public_ip_id']
        public_ip_data = public_ips[public_ip_id]
        public_ip = public_ip_data['address']
        public_dns_name = public_ip_data['fqdn']
        status = vm_statuses[vm_id]
        source = "Azure"
        instance_data = { 'public_ip': public_ip, 'public_dns_name': public_dns_name, 'status': status, 'source': source }
        normalized_data[name] = instance_data
    return normalized_data