def find_key_in_list(key, key_list):
    """
    Look for the right corresponding key in a list.

    key has to start with an given key from the list and the longest key
    will be returned.

    Parameters
    ----------
    key : str
        Given key.
    key_list : list of str
        Valid keys to be checked against.

    Returns
    -------
    found_key : :class:`str` or :class:`None`
        The best match. None if nothing was found.
    """
    found = []
    for try_key in key_list:
        if key.startswith(try_key):
            found.append(try_key)
    if found:
        found_key = max(found, key=len)
        # "" would be allowed for any given key
        if found_key:
            return found_key
    return None