import re


def split_into_chunks(code):
    """
    Split code into chunks, each chunk being a function definition
    """
    # Create an empty list to store chunks
    chunks = []
    # Create a string to store the current chunk
    chunk = ''
    # For each line in the code
    for line in code.splitlines():
        # If the line is a python or java function definition
        if re.match(r'^\s*(def|public|private)\s', line):
            # Add the current chunk to the list of chunks
            chunks.append(chunk)
            # And reset the current chunk
            chunk = ''
        # Add the line to the current chunk
        chunk += line + '\n'
    # Add the last chunk to the list of chunks
    chunks.append(chunk)
    # Return the list of chunks
    return chunks