def main(argv=sys.argv):
    if len(argv) != 7:
        usage(argv)
    for i in range(len(argv)):
        if argv[i] == "-t":
            trace_dir = argv[i + 1]
        if argv[i] == "-s":
            samples = int(argv[i + 1])
        if argv[i] == "-m":
            max_len = int(argv[i + 1])

    path_utils.walktree(trace_dir, build_from_file)
    lines_read = 0
    for window_size in range(3, max_len + 1):
        patterns = {}
        timing = {}
        for i in range(0, len(calls_list) - window_size):
            local = map(lambda l: l.split(':')[0],
                        calls_list[i: i + window_size])
            ttime = sum(map(int, map(lambda l: l.split(':')[1],
                                        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(local)
            if current in patterns:
                patterns[current] += 1
                timing[current] += ttime
            else:
                patterns[current] = 1
                timing[current] = ttime
        printed = {}
#        for pattern in sorted(timing,
#                              key=timing.get,
#                              reverse=True
#                             )[:samples]:
        for pattern in sorted(patterns,
                              key=patterns.get,
                              reverse=True
                             )[:samples]:
                # filter out permutations
                temp = pattern.split(' ')[:]
                temp.sort()
                if ' '.join(temp) in printed:
                    continue
                else:
                    printed[' '.join(temp)] = 1
                print pattern, patterns[pattern], timing[pattern]
        print "\n"
Returns a two-tuple of (command, plugins) that has the command
dataset/ETHPy150Open columbia/libtrack/libtrack/parser/scripts/patterns.py/main--crossover with--dataset/ETHPy150Open ProgVal/Limnoria/src/callbacks.py/NestedCommandsIrcProxy.findCallbacksForArgs