def loads(text, **kwargs):
regex = r'<STR_LIT>'<EOL>regex_inline = r'<STR_LIT>'<EOL>lines = text.split('<STR_LIT:\n>')<EOL>for index, line in enumerate(lines):<EOL><INDENT>if re.search(regex, line):<EOL><INDENT>if re.search(r'<STR_LIT>' + regex, line, re.IGNORECASE):<EOL><INDENT>lines[index] = "<STR_LIT>"<EOL><DEDENT>elif re.search(regex_inline, line):<EOL><INDENT>lines[index] = re.sub(regex_inline, r'<STR_LIT>', line)<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>return json.loads('<STR_LIT:\n>'.join(lines), **kwargs)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise JSONLibraryException(e)<EOL><DEDENT>
Deserialize `text` (a `str` or `unicode` instance containing a JSON
    document with Python or JavaScript like comments) to a Python object.

    :param text: serialized JSON string with or without comments.
    :param kwargs: all the arguments that `json.loads <http://docs.python.org/
                   2/library/json.html#json.loads>`_ accepts.
    :raises: commentjson.JSONLibraryException
    :returns: dict or list.