def to_string(self, ast_obj=None, fmt: str = "<STR_LIT>") -> str:
if not ast_obj:<EOL><INDENT>ast_obj = self<EOL><DEDENT>bel_relation = None<EOL>if self.bel_relation and fmt == "<STR_LIT>":<EOL><INDENT>bel_relation = self.spec["<STR_LIT>"]["<STR_LIT>"].get(<EOL>self.bel_relation, self.bel_relation<EOL>)<EOL><DEDENT>elif self.bel_relation:<EOL><INDENT>bel_relation = self.spec["<STR_LIT>"]["<STR_LIT>"].get(<EOL>self.bel_relation, self.bel_relation<EOL>)<EOL><DEDENT>if self.bel_subject and bel_relation and self.bel_object:<EOL><INDENT>if isinstance(self.bel_object, BELAst):<EOL><INDENT>return "<STR_LIT>".format(<EOL>self.bel_subject.to_string(fmt=fmt),<EOL>bel_relation,<EOL>self.bel_object.to_string(fmt=fmt),<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>".format(<EOL>self.bel_subject.to_string(fmt=fmt),<EOL>bel_relation,<EOL>self.bel_object.to_string(fmt=fmt),<EOL>)<EOL><DEDENT><DEDENT>elif self.bel_subject:<EOL><INDENT>return "<STR_LIT:{}>".format(self.bel_subject.to_string(fmt=fmt))<EOL><DEDENT>else:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>
Convert AST object to string

        Args:
            fmt (str): short, medium, long formatted BEL statements
                short = short function and short relation format
                medium = short function and long relation format
                long = long function and long relation format
            canonicalize

        Returns:
            str: string version of BEL AST