'Decode a JSON document from ``s`` (a ``str`` or ``unicode``
beginning with a JSON document) and return a 2-tuple of the Python
representation and the index in ``s`` where the document ended.
Optionally, ``idx`` can be used to specify an offset in ``s`` where
the JSON document begins.
This can be used to decode a JSON document from a string that may
have extraneous data at the end.'

def raw_decode(self, s, idx=0, _w=WHITESPACE.match, _PY3=PY3):

    if (_PY3 and (not isinstance(s, text_type))):
        raise TypeError('Input    string    must    be    text,    not    bytes')
    return self.scan_once(s, idx=_w(s, idx).end())
