def dispose(json_str):
result_str = list(json_str)<EOL>escaped = False<EOL>normal = True<EOL>sl_comment = False<EOL>ml_comment = False<EOL>quoted = False<EOL>a_step_from_comment = False<EOL>a_step_from_comment_away = False<EOL>former_index = None<EOL>for index, char in enumerate(json_str):<EOL><INDENT>if escaped:  <EOL><INDENT>escaped = False<EOL>continue<EOL><DEDENT>if a_step_from_comment:  <EOL><INDENT>if char != '<STR_LIT:/>' and char != '<STR_LIT:*>':<EOL><INDENT>a_step_from_comment = False<EOL>normal = True<EOL>continue<EOL><DEDENT><DEDENT>if a_step_from_comment_away:  <EOL><INDENT>if char != '<STR_LIT:/>':<EOL><INDENT>a_step_from_comment_away = False<EOL><DEDENT><DEDENT>if char == '<STR_LIT:">':<EOL><INDENT>if normal and not escaped:<EOL><INDENT>quoted = True<EOL>normal = False<EOL><DEDENT>elif quoted and not escaped:<EOL><INDENT>quoted = False<EOL>normal = True<EOL><DEDENT><DEDENT>elif char == '<STR_LIT:\\>':<EOL><INDENT>if normal or quoted:<EOL><INDENT>escaped = True<EOL><DEDENT><DEDENT>elif char == '<STR_LIT:/>':<EOL><INDENT>if a_step_from_comment:<EOL><INDENT>a_step_from_comment = False<EOL>sl_comment = True<EOL>normal = False<EOL>former_index = index - <NUM_LIT:1><EOL><DEDENT>elif a_step_from_comment_away:<EOL><INDENT>a_step_from_comment_away = False<EOL>normal = True<EOL>ml_comment = False<EOL>for i in range(former_index, index + <NUM_LIT:1>):<EOL><INDENT>result_str[i] = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif normal:<EOL><INDENT>a_step_from_comment = True<EOL>normal = False<EOL><DEDENT><DEDENT>elif char == '<STR_LIT:*>':<EOL><INDENT>if a_step_from_comment:<EOL><INDENT>a_step_from_comment = False<EOL>ml_comment = True<EOL>normal = False<EOL>former_index = index - <NUM_LIT:1><EOL><DEDENT>elif ml_comment:<EOL><INDENT>a_step_from_comment_away = True<EOL><DEDENT><DEDENT>elif char == '<STR_LIT:\n>':<EOL><INDENT>if sl_comment:<EOL><INDENT>sl_comment = False<EOL>normal = True<EOL>for i in range(former_index, index + <NUM_LIT:1>):<EOL><INDENT>result_str[i] = "<STR_LIT>"<EOL><DEDENT><DEDENT><DEDENT>elif char == '<STR_LIT:]>' or char == '<STR_LIT:}>':<EOL><INDENT>if normal:<EOL><INDENT>_remove_last_comma(result_str, index)<EOL><DEDENT><DEDENT><DEDENT>return ("<STR_LIT>" if isinstance(json_str, str) else u"<STR_LIT>").join(result_str)<EOL>
Clear all comments in json_str.

    Clear JS-style comments like // and /**/ in json_str.
    Accept a str or unicode as input.

    Args:
        json_str: A json string of str or unicode to clean up comment

    Returns:
        str: The str without comments (or unicode if you pass in unicode)