def predict(self, X, k=1, num_loops=0):
    '\n        Predict labels for test data using this classifier.\n\n        Inputs:\n        - X: A numpy array of shape (num_test, D) containing test data consisting\n             of num_test samples each of dimension D.\n        - k: The number of nearest neighbors that vote for the predicted labels.\n        - num_loops: Determines which implementation to use to compute distances\n          between training points and testing points.\n\n        Returns:\n        - y: A numpy array of shape (num_test,) containing predicted labels for the\n          test data, where y[i] is the predicted label for the test point X[i].\n        '
    if (num_loops == 0):
        dists = self.compute_distances_no_loops(X)
    elif (num_loops == 1):
        dists = self.compute_distances_one_loop(X)
    elif (num_loops == 2):
        dists = self.compute_distances_two_loops(X)
    else:
        raise ValueError(('Invalid value %d for num_loops' % num_loops))
    return self.predict_labels(dists, k=k)
Predict labels for test data using this classifier.

Inputs:
- X: A numpy array of shape (num_test, D) containing test data consisting
     of num_test samples each of dimension D.
- k: The number of nearest neighbors that vote for the predicted labels.
- num_loops: Determines which implementation to use to compute distances
  between training points and testing points.

Returns:
- y: A numpy array of shape (num_test,) containing predicted labels for the
  test data, where y[i] is the predicted label for the test point X[i].
def predict(self, X, k=1, num_loops=0):
    '\n        Predict labels for test data using this classifier.\n\n        Inputs:\n        - X: A numpy array of shape (num_test, D) containing test data consisting\n             of num_test samples each of dimension D.\n        - k: The number of nearest neighbors that vote for the predicted labels.\n        - num_loops: Determines which implementation to use to compute distances\n          between training points and testing points.\n\n        Returns:\n        - y: A numpy array of shape (num_test,) containing predicted labels for the\n          test data, where y[i] is the predicted label for the test point X[i].\n        '
    if (num_loops == 0):
        dists = self.compute_distances_no_loops(X)
    elif (num_loops == 1):
        dists = self.compute_distances_one_loop(X)
    elif (num_loops == 2):
        dists = self.compute_distances_two_loops(X)
    else:
        raise ValueError(('Invalid value %d for num_loops' % num_loops))
    return self.predict_labels(dists, k=k)