def partition_labels_from_mps(mps):
    """
    Get a list of partition labels, flattening any nested meta partitions in the input and ignoring sentinels.

    Parameters
    ----------
    mps: List[MetaPartition]

    Returns
    -------
    partition_labels: List[str]
    """
    partition_labels = []
    for mp in mps:
        if len(mp) > 1:
            for nested_mp in mp:
                if not nested_mp.is_sentinel:
                    partition_labels.append(nested_mp.label)
        else:
            if not mp.is_sentinel:
                partition_labels.append(mp.label)
    return partition_labels