def METHOD_NAME(u, num):
    # sample num neg items for u-th user
    neg_items = []
    while True:
        if len(neg_items) == num:
            break
        neg_id = np.random.randint(low=0, high=self.n_items, size=1)[0]
        if (
            neg_id not in self.train_items[u]
            and neg_id not in neg_items
        ):
            neg_items.append(neg_id)
    return neg_items