def get_index_by_name(name, labels):
    """get index(=labelcode) of name

    Args:
        name ([String]): [name]
        labels ([dict]): [labels]

    Returns:
        [int]: [index]
    """
    index = int(-1)
    for x in labels:
        if (x.get('name')==name):
            index = x.get('labelcode')
            break

    if (index == -1):
        print(f"{name} is no label")
    else:
        return index