@staticmethod
def pipe_chunk(chunks, piped_chunk_func, to_chunk_marker: int, yes: int):
    """
        Re-chunks in place the chunks produced by a previous chunking method.

        :param chunks: the chunks from a previous chunking method
        :param piped_chunk_func: new chunking method to apply
        :param to_chunk_marker: chunk-mark to identify which chunks will be re-chunked
        :param yes: new chunk-mark to be used for matching chunks (leave empty to use default value)
                    The new chunks not passing the internal test will keep the previous chunk-mark.
        :type chunks: list of tuples containing each 3 ints
        :type piped_chunk_func: callable
        :type yes: int
        """
    for i, chunk in enumerate(chunks):
        if chunk[0] == to_chunk_marker:
            new = piped_chunk_func(chunk[1], chunk[1] + chunk[2], yes=yes)
            if new:
                del chunks[i]
                for j, n_chunk in enumerate(new):
                    if n_chunk[0] != yes:
                        chunks.insert(i + j, (chunk[0], n_chunk[1], n_chunk[2])
                            )
                    else:
                        chunks.insert(i + j, n_chunk)
    return chunks
