(blocks, errors)
blocks contains ConfigBlocks as a tree. This function makes sure that each yaml object has no duplicates
    variables and return a list of errors to be displayed if duplicates are found. The @param declaration needs to
    be there for this to correctly identify a variable.
blocks contains ConfigBlocks as a tree. This function makes sure that each yaml object has no duplicates
    variables and return a list of errors to be displayed if duplicates are found. The
blocks contains ConfigBlocks as a tree . This function makes sure that each yaml object has no duplicates variables and return a list of errors to be displayed if duplicates are found . The
def _check_no_duplicate_names(blocks, errors):
    """blocks contains ConfigBlocks as a tree. This function makes sure that each yaml object has no duplicates
    variables and return a list of errors to be displayed if duplicates are found. The @param declaration needs to
    be there for this to correctly identify a variable.
    """
    same_level_blocks = [b for b in blocks if isinstance(b, ConfigBlock)]
    names_list = [b.param_prop.var_name for b in same_level_blocks if b.param_prop]
    duplicates = set([x for x in names_list if names_list.count(x) > 1])
    for dup in duplicates:
        errors.append(ValidatorError(f"Duplicate variable with name {dup}", None))

    sub_lists_of_other_blocks = [b for b in blocks if isinstance(b, list)]
    for l in sub_lists_of_other_blocks:
        _check_no_duplicate_names(l, errors)
def _check_no_duplicate_names ( blocks , errors ) : same_level_blocks = [ b for b in blocks if isinstance ( b , ConfigBlock ) ] names_list = [ b . param_prop . var_name for b in same_level_blocks if b . param_prop ] duplicates = set ( [ x for x in names_list if names_list . count ( x ) > 1 ] ) for dup in duplicates : errors . append ( ValidatorError ( f"Duplicate variable with name {dup}" , None ) ) sub_lists_of_other_blocks = [ b for b in blocks if isinstance ( b , list ) ] for l in sub_lists_of_other_blocks : _check_no_duplicate_names ( l , errors )