def tokenize_function(examples, tokenizer, block_size):
    """
    This function will take the text dataset and complete this steps below

    1. Tokenize the entire dataset
    2. Concatenate all examples from 2d list into a 1D
    3. Create blocks of the concatenated examples with a certain block size
    4. Create labels for the dataset

    @params:
        examples: The dataset to be tokenized
        tokenizer: The tokenizer to be used for tokenizing the dataset
        block_size: The size of the blocks to be created

    @returns:
        Tokenized dataset with labels
    """

    #1. Tokenize the entire dataset
    tokenized_examples = tokenizer(examples["text"])

    #2. Concatenate all examples from 2d list into a 1D
    # Going to flatten ['text'], ['input_ids'], ['attention_masks] from 2D lists to 1D lists or concatenate them
    concatenated_examples = {key:sum(tokenized_examples[key], []) for key in tokenized_examples.keys()}

    #3. Create blocks of the concatenated examples with a certain block size
    # Getting the total number of words
    num_tokens = len(concatenated_examples['input_ids'])
    # Getting the number of blocks; Cutting the that are left over that cannot make another block
    total_length = (num_tokens // block_size) * block_size

    results = {}
    for key, value in concatenated_examples.items():
        blocks = []
        for i in range(0, total_length, block_size):
            blocks.append(value[i: i+block_size])

        results[key] = blocks

    #4. Create labels for the dataset
    results['labels'] = results['input_ids'].copy()

    return results