def output(migrations_obj):
    detail_keys = ['memory_total', 'memory_processed', 'memory_remaining',
                   'disk_total', 'disk_processed', 'disk_remaining']
    # Note(Shaohe Feng): We need to leverage the oslo.versionedobjects.
    # Then we can pass the target version to it's obj_to_primitive.
    objects = obj_base.obj_to_primitive(migrations_obj)
    objects = [x for x in objects if not x['hidden']]
    for obj in objects:
        del obj['deleted']
        del obj['deleted_at']
        del obj['migration_type']
        del obj['hidden']
        if 'memory_total' in obj:
            for key in detail_keys:
                del obj[key]

    return objects
Returns the desired output of the API from an object.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/api/openstack/compute/legacy_v2/contrib/migrations.py/output