def check_none(data, moban_file):
    """
    check whether the yaml data has empty value such as:
    """
    if isinstance(data, dict):
        for k, v in data.items():
            if check_none(v, moban_file) is None:
                loc = data.lc.key(k)
                raise exceptions.MobanfileGrammarException(
                    constants.ERROR_MALFORMED_YAML
                    % (moban_file, loc[0] + 1)  # line number starts from 0
                )
    elif isinstance(data, list):
        for i, x in enumerate(data):
            if check_none(x, moban_file) is None:
                loc = data.lc.item(i)
                raise exceptions.MobanfileGrammarException(
                    constants.ERROR_MALFORMED_YAML % (moban_file, loc[0] + 1)
                )
    return data
def check_none ( data , moban_file ) : if isinstance ( data , dict ) : for k , v in data . items ( ) : if check_none ( v , moban_file ) is None : loc = data . lc . key ( k ) raise exceptions . MobanfileGrammarException ( constants . ERROR_MALFORMED_YAML % ( moban_file , loc [ 0 ] + 1 ) ) elif isinstance ( data , list ) : for i , x in enumerate ( data ) : if check_none ( x , moban_file ) is None : loc = data . lc . item ( i ) raise exceptions . MobanfileGrammarException ( constants . ERROR_MALFORMED_YAML % ( moban_file , loc [ 0 ] + 1 ) ) return data
check whether the yaml data has empty value such as: