def remove_objects(code, count=<NUM_LIT:1>):
replacements = {}  <EOL>br = bracket_split(code, ['<STR_LIT:{}>', '<STR_LIT>'])<EOL>res = '<STR_LIT>'<EOL>last = '<STR_LIT>'<EOL>for e in br:<EOL><INDENT>if e[<NUM_LIT:0>] == '<STR_LIT:{>':<EOL><INDENT>n, temp_rep, cand_count = remove_objects(e[<NUM_LIT:1>:-<NUM_LIT:1>], count)<EOL>if is_object(n, last):<EOL><INDENT>res += '<STR_LIT:U+0020>' + OBJECT_LVAL % count<EOL>replacements[OBJECT_LVAL % count] = e<EOL>count += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>res += '<STR_LIT>' % n<EOL>count = cand_count<EOL>replacements.update(temp_rep)<EOL><DEDENT><DEDENT>elif e[<NUM_LIT:0>] == '<STR_LIT:[>':<EOL><INDENT>if is_array(last):<EOL><INDENT>res += e  <EOL><DEDENT>else:  <EOL><INDENT>n, rep, count = remove_objects(e[<NUM_LIT:1>:-<NUM_LIT:1>], count)<EOL>res += '<STR_LIT>' % n<EOL>replacements.update(rep)<EOL><DEDENT><DEDENT>else:  <EOL><INDENT>res += e<EOL><DEDENT>last = e  <EOL><DEDENT>return res, replacements, count<EOL>
This function replaces objects with OBJECTS_LVALS, returns new code, replacement dict and count.
        count arg is the number that should be added to the LVAL of the first replaced object