human
Here's a good function header given the following:
I wrote the below code

    def null_safe_str(s):
        return (str(s) if s else '')
    image_ref_url = glance.generate_image_url(instance_ref['image_ref'])
    instance_type = instance_types.extract_instance_type(instance_ref)
    instance_type_name = instance_type.get('name', '')
    if (system_metadata is None):
        system_metadata = utils.metadata_to_dict(instance_ref['system_metadata'])
    instance_info = dict(tenant_id=instance_ref['project_id'], user_id=instance_ref['user_id'], instance_id=instance_ref['uuid'], display_name=instance_ref['display_name'], reservation_id=instance_ref['reservation_id'], hostname=instance_ref['hostname'], instance_type=instance_type_name, instance_type_id=instance_ref['instance_type_id'], architecture=instance_ref['architecture'], memory_mb=instance_ref['memory_mb'], disk_gb=(instance_ref['root_gb'] + instance_ref['ephemeral_gb']), vcpus=instance_ref['vcpus'], root_gb=instance_ref['root_gb'], ephemeral_gb=instance_ref['ephemeral_gb'], host=instance_ref['host'], availability_zone=instance_ref['availability_zone'], created_at=str(instance_ref['created_at']), deleted_at=null_safe_str(instance_ref.get('terminated_at')), launched_at=null_safe_str(instance_ref.get('launched_at')), image_ref_url=image_ref_url, os_type=instance_ref['os_type'], kernel_id=instance_ref['kernel_id'], ramdisk_id=instance_ref['ramdisk_id'], state=instance_ref['vm_state'], state_description=null_safe_str(instance_ref.get('task_state')), access_ip_v4=instance_ref['access_ip_v4'], access_ip_v6=instance_ref['access_ip_v6'])
    if (network_info is not None):
        fixed_ips = []
        for vif in network_info:
            for ip in vif.fixed_ips():
                ip['label'] = vif['network']['label']
                fixed_ips.append(ip)
        instance_info['fixed_ips'] = fixed_ips
    image_meta_props = image_meta(system_metadata)
    instance_info['image_meta'] = image_meta_props
    instance_info['metadata'] = instance_ref['metadata']
    instance_info.update(kw)
    return instance_info

What's a good function header?
assistant
#Here's a good function header.

def info_from_instance(context, instance_ref, network_info, system_metadata, **kw):