def _parse_json(raw):
    """Parse raw JSON file."""
    try:
        parsed = json.loads(raw, object_pairs_hook=collections.OrderedDict)
    except __HOLE__ as err:
        note = str(err)
        # if demjson is available, print its diagnostic string as well
        if demjson:
            demerr = _get_demjson_diagnostics(raw)
            if demerr:
                note += "\n" + demerr
        raise ParserException(note)
    else:
        return parsed
dataset/ETHPy150Open openstack/openstack-doc-tools/os_doc_tools/jsoncheck.py/_parse_json