def METHOD_NAME(self, data, n, m, idx):
    """
    calculate precision in recall n
    """
    pos_score = data[idx][0]
    curr = data[idx : idx + m]
    curr = sorted(curr, key=lambda x: x[0], reverse=True)
    if curr[n - 1][0] <= pos_score:
        return 1
    return 0