def compare_flavors(flavor_item):
    """
    Helper function for sorting flavors.
    Sorting order: Flavors with lower resources first.
    Resource importance order: GPUs, CPUs, RAM, Disk, Ephemeral.

    :param flavor_item:

    :return:
    """
    return (
        flavor_item.get("Properties", {}).get("Accelerator:Number", "0"),
        flavor_item.get("VCPUs"),
        flavor_item.get("RAM"),
        flavor_item.get("Disk"),
        flavor_item.get("Ephemeral"),
    )