docs: def _compile_key_val(self, data, indent_level):
          """Compile a dictionary."""
          buffer = ''
          for (key, val) in data.items():
              buffer += self._indent * indent_level
              # TODO: assumes key is a string
              buffer += key + ':'
  
              if isinstance(val, dict):
                  buffer += '\n'
                  buffer += self._compile_key_val(val, indent_level+1)
              elif (
                  isinstance(val, list) and
                  any(isinstance(i, (dict, list)) for i in val)
              ):
                  buffer += self._compile_list(val, indent_level+1)
              else:
                  buffer += ' '
                  buffer += self._compile_value(val, indent_level)
                  buffer += '\n'
  
          return buffer