import re


def remove_structure_definitions(data):
    """
    Remove lines of code that aren't representative of LLVM-IR "language"
    and shouldn't be used for training the embeddings
    :param data: input data as a list of files where each file is a list of strings
    :return: input data with non-representative lines of code removed
    """
    print('Removing structure (aggregate types) definitions ...')
    for i in range(len(data)):
        data[i] = [line for line in data[i] if not re.match('%.* = type (<?{ .* }|opaque|{})', line)]

    return data