def canonical_ops(ops):
    ''' Returns the given operations array sorted with duplicates removed.
    @param ops checker.Ops
    @return: checker.Ops
    '''
    new_ops = sorted(set(ops), key=lambda x: (x.entity, x.action))
    return new_ops