docstr: Convert HOCON input into a .properties output
  
  :return: .properties string representation
  :type return: basestring
  :return:
docstr_tok: ["Convert","HOCON","input","into","a",".properties","output",":","return",":",".properties","string","representation",":","type","return",":","basestring",":","return",":"]
code: def to_properties(cls, config, compact=False, indent=2, key_stack=[]):
      """Convert HOCON input into a .properties output
  
      :return: .properties string representation
      :type return: basestring
      :return:
      """
  
      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])
  
file_path: clearml/clearml/utilities/pyhocon/converter.py
imports: import json
  import re
  import sys
  from .None import ConfigFactory
  from .config_tree import ConfigQuotedString
  from .config_tree import ConfigSubstitution
  from .config_tree import ConfigTree
  from .config_tree import ConfigValues
  from .config_tree import NoneValue
label_desc: Use image node_id 5 for calling the HOCONConverter obj's underlying member method code with example usage: obj.to_properties(cls, config, compact, indent, key_stack) and returns: str, value