from typing import Iterable


def check_descriptor_length(descriptor, n_element):
    """
    Checks whether the entries of a descriptor dictionary have the right length.
    Converts single-strings to a list of 1 element.

    Args:
        descriptor(dict): the descriptor dictionary
        n_element: the correct length of the descriptors

    Returns:
        bool

    """
    for k, v in descriptor.items():
        if isinstance(v, str):
            v = [v]
        if isinstance(v, Iterable) and len(v) != n_element:
            return False
    return True