from collections import Counter

__author__ = 'ASUS'

def getOpcodeNgram(ops, n=2):

    opngramlist = [tuple(ops[i:i + n]) for i in range(len(ops) - n)]
    op2gram = Counter(opngramlist)
    return op2gram
