(blocks, errors)
blocks contains ConfigBlocks as a tree. This function iterate over it to run the validate method on each
    ConfigBlock and append errors to the provided array if needed.
blocks contains ConfigBlocks as a tree. This function iterate over it to run the validate method on each
    ConfigBlock and append errors to the provided array if needed.
blocks contains ConfigBlocks as a tree . This function iterate over it to run the validate method on each ConfigBlock and append errors to the provided array if needed .
def _validate_blocks(blocks, errors):
    """blocks contains ConfigBlocks as a tree. This function iterate over it to run the validate method on each
    ConfigBlock and append errors to the provided array if needed.
    """
    leaves = [b for b in blocks if isinstance(b, ConfigBlock)]
    for b in leaves:
        b.validate(errors)
    nodes = [b for b in blocks if isinstance(b, list)]
    for n in nodes:
        _validate_blocks(n, errors)
def _validate_blocks ( blocks , errors ) : leaves = [ b for b in blocks if isinstance ( b , ConfigBlock ) ] for b in leaves : b . validate ( errors ) nodes = [ b for b in blocks if isinstance ( b , list ) ] for n in nodes : _validate_blocks ( n , errors )