def METHOD_NAME(self, posting1, compressed_sorted_functions, sorted_files=None):
    '''
     Intersects postings with the given functions and sorted_files
     Parameters:
     posting1 postings. posting is [[file_id1,line, [compressed_functions]],..]
     compressed_sorted_functions compressed sorted function index to be intersected
     sorted_files  sorted index of files to be Intersected with the result [ default is None]
     Returns:
     filtered uncompressed posting
    '''
    new_postings = []
    if sorted_files is not None:
        i, j = 0, 0
        len_1 = len(posting1)
        len_2 = len(sorted_files)
        while i < len_1 and j < len_2:
            file_1 = posting1[i][0]
            file_2 = sorted_files[j]
            if file_1 < file_2:
                i += 1
            elif file_1 > file_2:
                j += 1
            else:
                new_postings.append(posting1[i])
                i += 1
                # dont increase sorted_files in this case
                # j=+1
    input_p = new_postings if sorted_files is not None else posting1
    # search and intersect all functions
    new_list = []
    for p in input_p:
        px = intersect_compressed_sorted_list(
            compressed_sorted_functions, p[2])
        if len(px) > 0:
            new_list.append([p[0], p[1], px])
    return new_list