def missing_abstractions(trace_graph, settings):
    """
    Identify missing abstration of frequently occuring
    patterns and print them.
    """
    posix_calls_list = trace_graph.posix_calls_list
    max_window_size = settings.MISSING_ABSTR_MAX_WINDOW_SIZE
    threashold = settings.MISSING_ABSTR_SAMPLES
    for window_size in range(3, max_window_size + 1):
        patterns = {}
        for i in range(0, len(posix_calls_list) - window_size):
            local = posix_calls_list[i: i + window_size]
            # the following will remove circles
            if sorted([local.count(i) for i in local])[-1] > 1:
                continue
            #current = '->'.join(map(lambda s: s.split(':')[2], local))
            current = '->'.join(local)
            if current in patterns:
                patterns[current] += 1
            else:
                patterns[current] = 1
        for pattern in \
            sorted(patterns, key=patterns.get, reverse=True)[:threashold]:
            yield pattern, patterns[pattern]
        print "\n"
dataset/ETHPy150Open columbia/libtrack/libtrack/parser/src/telesphorus/abstractions.py/missing_abstractions/original