def check_nested_dict_keys(check_dict: dict, keys: list) -> bool:
    """Checks if dictionary contains nested keys from keys list.

    Args:
        check_dict: Dictionary to check.
        keys: Keys list. i-th nested dict of ``check_dict`` should contain dict containing (i+1)-th key
        from the ``keys`` list by i-th key.

    Returns:
        True if dictionary contains nested keys from keys list, False otherwise.

    Examples:
        >>> check_nested_dict_keys({'x': {'y': {'z': 42}}}, ['x', 'y', 'z'])
        True
        >>> check_nested_dict_keys({'x': {'y': {'z': 42}}}, ['x', 'z', 'y'])
        False
        >>> check_nested_dict_keys({'x': {'y': 1, 'z': 42}}, ['x', 'y', 'z'])
        False

    """
    if isinstance(keys, list) and len(keys) > 0:
        element = check_dict
        for key in keys:
            if isinstance(element, dict) and key in element.keys():
                element = element[key]
            else:
                return False
        return True
    else:
        return False
Checks if dictionary contains nested keys from keys list.

    Args:
        check_dict: Dictionary to check.
        keys: Keys list. i-th nested dict of ``check_dict`` should contain dict containing (i+1)-th key
        from the ``keys`` list by i-th key.

    Returns:
        True if dictionary contains nested keys from keys list, False otherwise.

    Examples:
        >>> check_nested_dict_keys({'x': {'y': {'z': 42}}}, ['x', 'y', 'z'])
        True
        >>> check_nested_dict_keys({'x': {'y': {'z': 42}}}, ['x', 'z', 'y'])
        False
        >>> check_nested_dict_keys({'x': {'y': 1, 'z': 42}}, ['x', 'y', 'z'])
        False

    
deeppavlov/core/data/utils.py