docs: def completeness(self, catalogue, config, saveplot=False, filetype='png',
                       timeout=120):
          '''
          :param catalogue:
              Earthquake catalogue as instance of
              :class:`openquake.hmtk.seismicity.catalogue.Catalogue`
          :param dict config:
              Configuration parameters of the algorithm, containing the
              following information:
              'magnitude_bin' Size of magnitude bin (non-negative float)
              'time_bin' Size (in dec. years) of the time window (non-negative
              float)
              'increment_lock' Boolean to indicate whether to ensure
              completeness magnitudes always decrease with more
              recent bins
          :returns:
              2-column table indicating year of completeness and corresponding
              magnitude numpy.ndarray
          '''
          if saveplot and not isinstance(saveplot, str):
              raise ValueError('To save the figures enter a filename: ')
  
          # Get magntitude bins
          magnitude_bins = self._get_magnitudes_from_spacing(
              catalogue.data['magnitude'],
              config['magnitude_bin'])
          dec_time = catalogue.get_decimal_time()
          completeness_table = np.zeros([len(magnitude_bins) - 1, 2],
                                        dtype=float)
          min_year = float(np.min(catalogue.data['year']))
          max_year = float(np.max(catalogue.data['year'])) + 1.0
          has_completeness = np.zeros(len(magnitude_bins) - 1, dtype=bool)
          for iloc in range(0, len(magnitude_bins) - 1):
              lower_mag = magnitude_bins[iloc]
              upper_mag = magnitude_bins[iloc + 1]
              idx = np.logical_and(catalogue.data['magnitude'] >= lower_mag,
                                   catalogue.data['magnitude'] < upper_mag)
              cumvals = np.cumsum(np.ones(np.sum(idx)))
              plt.plot(dec_time[idx], cumvals, '.')
              plt.xlim(min_year, max_year + 5)
              title_string = 'Magnitude %5.2f to %5.2f' % (lower_mag, upper_mag)
              plt.title(title_string)
              pts = pylab.ginput(1, timeout=timeout)[0]
              if pts[0] <= max_year:
                   # Magnitude bin has no completeness!
                  has_completeness[iloc] = True
              completeness_table[iloc, 0] = np.floor(pts[0])
              completeness_table[iloc, 1] = magnitude_bins[iloc]
              print(completeness_table[iloc, :], has_completeness[iloc])
              if config['increment_lock'] and (iloc > 0) and \
                      (completeness_table[iloc, 0] > completeness_table[iloc - 1, 0]):
                  completeness_table[iloc, 0] = \
                      completeness_table[iloc - 1, 0]
              # Add marker line to indicate completeness point
              marker_line = np.array([
                  [0., completeness_table[iloc, 0]],
                  [cumvals[-1], completeness_table[iloc, 0]]])
              plt.plot(marker_line[:, 0], marker_line[:, 1], 'r-')
              if saveplot:
                  filename = saveplot + '_' + ('%5.2f' % lower_mag) + (
                      '%5.2f' % upper_mag) + '.' + filetype
                  plt.savefig(filename, format=filetype)
              plt.close()
          return completeness_table[has_completeness, :]