<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_colorbar(self, **kwargs):
 """Draw a colorbar """

        kwargs = kwargs.copy()
        if self._cmap_extend is not None:
            kwargs.setdefault('extend', self._cmap_extend)
        if 'label' not in kwargs:
            kwargs.setdefault('label', label_from_attrs(self.data))
        self.cbar = self.fig.colorbar(self._mappables[-1],
                                      ax=list(self.axes.flat),
                                      **kwargs)
        return self