def sre_to_string(sre_obj, paren=True):
ret = u'<STR_LIT>'<EOL>for i in sre_obj:<EOL><INDENT>if i[<NUM_LIT:0>] == sre_parse.IN:<EOL><INDENT>prefix = '<STR_LIT>'<EOL>if len(i[<NUM_LIT:1>]) and i[<NUM_LIT:1>][<NUM_LIT:0>][<NUM_LIT:0>] == sre_parse.NEGATE:<EOL><INDENT>prefix = '<STR_LIT>'<EOL><DEDENT>ret += u'<STR_LIT>'.format(prefix, sre_to_string(i[<NUM_LIT:1>], paren=paren))<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.LITERAL:<EOL><INDENT>u = unichr(i[<NUM_LIT:1>])<EOL>ret += u if u not in sre_parse.SPECIAL_CHARS else '<STR_LIT>'.format(u)<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.CATEGORY:<EOL><INDENT>ret += REVERSE_CATEGORIES[i[<NUM_LIT:1>]]<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.ANY:<EOL><INDENT>ret += '<STR_LIT:.>'<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.BRANCH:<EOL><INDENT>parts = [sre_to_string(x, paren=paren) for x in i[<NUM_LIT:1>][<NUM_LIT:1>]]<EOL>if not any(parts):<EOL><INDENT>continue<EOL><DEDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>]:<EOL><INDENT>if len(parts) == <NUM_LIT:1>:<EOL><INDENT>paren = False<EOL><DEDENT>prefix = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>prefix = '<STR_LIT>'<EOL><DEDENT>branch = '<STR_LIT:|>'.join(parts)<EOL>if paren:<EOL><INDENT>ret += '<STR_LIT>'.format(prefix, branch)<EOL><DEDENT>else:<EOL><INDENT>ret += '<STR_LIT>'.format(branch)<EOL><DEDENT><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.SUBPATTERN:<EOL><INDENT>subexpr = i[<NUM_LIT:1>][<NUM_LIT:1>]<EOL>if IS_PY36_OR_GREATER and i[<NUM_LIT:0>] == sre_parse.SUBPATTERN:<EOL><INDENT>subexpr = i[<NUM_LIT:1>][<NUM_LIT:3>]<EOL><DEDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>]:<EOL><INDENT>ret += '<STR_LIT>'.format(sre_to_string(subexpr, paren=False))<EOL><DEDENT>else:<EOL><INDENT>ret += '<STR_LIT>'.format(sre_to_string(subexpr, paren=paren))<EOL><DEDENT><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.NOT_LITERAL:<EOL><INDENT>ret += '<STR_LIT>'.format(unichr(i[<NUM_LIT:1>]))<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.MAX_REPEAT:<EOL><INDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>] == i[<NUM_LIT:1>][<NUM_LIT:1>]:<EOL><INDENT>range_str = '<STR_LIT>'.format(i[<NUM_LIT:1>][<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>] == <NUM_LIT:0> and i[<NUM_LIT:1>][<NUM_LIT:1>] - i[<NUM_LIT:1>][<NUM_LIT:0>] == sre_parse.MAXREPEAT:<EOL><INDENT>range_str = '<STR_LIT:*>'<EOL><DEDENT>elif i[<NUM_LIT:1>][<NUM_LIT:0>] == <NUM_LIT:1> and i[<NUM_LIT:1>][<NUM_LIT:1>] - i[<NUM_LIT:1>][<NUM_LIT:0>] == sre_parse.MAXREPEAT - <NUM_LIT:1>:<EOL><INDENT>range_str = '<STR_LIT:+>'<EOL><DEDENT>else:<EOL><INDENT>range_str = '<STR_LIT>'.format(i[<NUM_LIT:1>][<NUM_LIT:0>], i[<NUM_LIT:1>][<NUM_LIT:1>])<EOL><DEDENT><DEDENT>ret += sre_to_string(i[<NUM_LIT:1>][<NUM_LIT:2>], paren=paren) + range_str<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.MIN_REPEAT:<EOL><INDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>] == <NUM_LIT:0> and i[<NUM_LIT:1>][<NUM_LIT:1>] == sre_parse.MAXREPEAT:<EOL><INDENT>range_str = '<STR_LIT>'<EOL><DEDENT>elif i[<NUM_LIT:1>][<NUM_LIT:0>] == <NUM_LIT:1> and i[<NUM_LIT:1>][<NUM_LIT:1>] == sre_parse.MAXREPEAT:<EOL><INDENT>range_str = '<STR_LIT>'<EOL><DEDENT>elif i[<NUM_LIT:1>][<NUM_LIT:1>] == sre_parse.MAXREPEAT:<EOL><INDENT>range_str = '<STR_LIT>'.format(i[<NUM_LIT:1>][<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>range_str = '<STR_LIT>'.format(i[<NUM_LIT:1>][<NUM_LIT:0>], i[<NUM_LIT:1>][<NUM_LIT:1>])<EOL><DEDENT>ret += sre_to_string(i[<NUM_LIT:1>][<NUM_LIT:2>], paren=paren) + range_str<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.GROUPREF:<EOL><INDENT>ret += '<STR_LIT>'.format(i[<NUM_LIT:1>])<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.AT:<EOL><INDENT>if i[<NUM_LIT:1>] == sre_parse.AT_BEGINNING:<EOL><INDENT>ret += '<STR_LIT>'<EOL><DEDENT>elif i[<NUM_LIT:1>] == sre_parse.AT_END:<EOL><INDENT>ret += '<STR_LIT:$>'<EOL><DEDENT><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.NEGATE:<EOL><INDENT>pass<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.RANGE:<EOL><INDENT>ret += '<STR_LIT>'.format(unichr(i[<NUM_LIT:1>][<NUM_LIT:0>]), unichr(i[<NUM_LIT:1>][<NUM_LIT:1>]))<EOL><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.ASSERT:<EOL><INDENT>if i[<NUM_LIT:1>][<NUM_LIT:0>]:<EOL><INDENT>ret += '<STR_LIT>'.format(sre_to_string(i[<NUM_LIT:1>][<NUM_LIT:1>], paren=False))<EOL><DEDENT>else:<EOL><INDENT>ret += '<STR_LIT>'.format(sre_to_string(i[<NUM_LIT:1>][<NUM_LIT:1>], paren=paren))<EOL><DEDENT><DEDENT>elif i[<NUM_LIT:0>] == sre_parse.ASSERT_NOT:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>' % str(i))<EOL><DEDENT><DEDENT>return ret<EOL>
sre_parse object to string

    :param sre_obj: Output of sre_parse.parse()
    :type sre_obj: list
    :rtype: str