code: def to_properties(cls, config, compact=False, indent=2, key_stack=[]):
          
  
          def escape_value(value):
              return value.replace('=', '\\=').replace('!', '\\!').replace('#', '\\#').replace('\n', '\\\n')
  
          stripped_key_stack = [key.strip('"') for key in key_stack]
          lines = []
          if isinstance(config, ConfigTree):
              for key, item in config.items():
                  if item is not None:
                      lines.append(cls.to_properties(item, compact, indent, stripped_key_stack + [key]))
          elif isinstance(config, list):
              for index, item in enumerate(config):
                  if item is not None:
                      lines.append(cls.to_properties(item, compact, indent, stripped_key_stack + [str(index)]))
          elif isinstance(config, basestring):
              lines.append('.'.join(stripped_key_stack) + ' = ' + escape_value(config))
          elif config is True:
              lines.append('.'.join(stripped_key_stack) + ' = true')
          elif config is False:
              lines.append('.'.join(stripped_key_stack) + ' = false')
          elif config is None or isinstance(config, NoneValue):
              pass
          else:
              lines.append('.'.join(stripped_key_stack) + ' = ' + str(config))
          return '\n'.join([line for line in lines if len(line) > 0])
docs: Convert HOCON input into a .properties output
  
          :return: .properties string representation
          :type return: basestring
          :return: