from pathlib import Path


def find_lab(directory, utt_id):
    """Find label for a given utterance.

    Args:
        directory (str): directory to search
        utt_id (str): utterance id

    Returns:
        str: path to the label file
    """
    if isinstance(directory, str):
        directory = Path(directory)
    ps = sorted(directory.rglob(f"{utt_id}.lab"))
    assert len(ps) == 1
    return ps[0]