def encode(self, obj, qualifier: str):
LOGGER.debug('<STR_LIT>')<EOL>if not obj:<EOL><INDENT>if qualifier.replace('<STR_LIT:=>', '<STR_LIT>').rstrip() == '<STR_LIT>':<EOL><INDENT>return '<STR_LIT>'.format(qualifier, qualifier.replace('<STR_LIT:=>', '<STR_LIT>').rstrip())<EOL><DEDENT>else:<EOL><INDENT>LOGGER.error('<STR_LIT>'.format(qualifier, qualifier.replace('<STR_LIT:=>', '<STR_LIT>').rstrip()))<EOL>raise SLTPEmptyObjectError(qualifier)<EOL><DEDENT><DEDENT>self.depth = <NUM_LIT:0><EOL>out = []<EOL>s = self.__encode(obj)<EOL>lines = s.split(self.newline)<EOL>for line in lines:<EOL><INDENT>m = self.line_end.match(line)<EOL>if m:<EOL><INDENT>out.append('<STR_LIT>'.format(m.group('<STR_LIT>'), m.group('<STR_LIT>')))<EOL><DEDENT>else:<EOL><INDENT>out.append(line)<EOL><DEDENT><DEDENT>return '<STR_LIT>'.format(qualifier, self.newline.join(out), qualifier.replace('<STR_LIT:=>', '<STR_LIT>').rstrip())<EOL>
Encodes a dictionary-like object to a Lua string
        :param qualifier:
        :param obj: object to encode
        :return: valid Lua string