<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot(self, figsize=None, rotation=45):
 """Plot the confusion matrix. Args: figsize: tuple (x, y) of ints. Sets the size of the figure rotation: the rotation angle of the labels on the x-axis. """


    fig, ax = plt.subplots(figsize=figsize)

    plt.imshow(self._cm, interpolation='nearest', cmap=plt.cm.Blues, aspect='auto')
    plt.title('Confusion matrix')
    plt.colorbar()
    tick_marks = np.arange(len(self._labels))
    plt.xticks(tick_marks, self._labels, rotation=rotation)
    plt.yticks(tick_marks, self._labels)
    if isinstance(self._cm, list):
      # If cm is created from BigQuery then it is a list.
      thresh = max(max(self._cm)) / 2.
      for i, j in itertools.product(range(len(self._labels)), range(len(self._labels))):
        plt.text(j, i, self._cm[i][j], horizontalalignment="center",
                 color="white" if self._cm[i][j] > thresh else "black")
    else:
      # If cm is created from csv then it is a sklearn's confusion_matrix.
      thresh = self._cm.max() / 2.
      for i, j in itertools.product(range(len(self._labels)), range(len(self._labels))):
        plt.text(j, i, self._cm[i, j], horizontalalignment="center",
                 color="white" if self._cm[i, j] > thresh else "black")
    plt.tight_layout()
    plt.ylabel('True label')
    plt.xlabel('Predicted label')