code: def _check(self):
          
          for k,ix in six.iteritems(self._indices):
              assert k is not None, 'null key'
              assert ix, 'Key does not map to any indices'
              assert ix == sorted(ix), "Key's indices are not in order"
              for i in ix:
                  assert i in self._lines, 'Key index does not map to line'
                  assert self._lines[i].key is not None, 'Key maps to comment'
                  assert self._lines[i].key == k, 'Key does not map to itself'
                  assert self._lines[i].value is not None, 'Key has null value'
          prev = None
          for i, line in six.iteritems(self._lines):
              assert prev is None or prev < i, 'Line indices out of order'
              prev = i
              if line.key is None:
                  assert line.value is None, 'Comment/blank has value'
                  assert line.source is not None, 'Comment source not stored'
                  assert loads(line.source) == {}, 'Comment source is not comment'
              else:
                  assert line.value is not None, 'Key has null value'
                  if line.source is not None:
                      assert loads(line.source) == {line.key: line.value}, \
                          'Key source does not deserialize to itself'
                  assert line.key in self._indices, 'Key is missing from map'
                  assert i in self._indices[line.key], \
                      'Key does not map to itself'
docs: Assert the internal consistency of the instance's data structures.
          This method is for debugging only.