def json_splitter(buffer):
 try:
  (obj, index) = json_decoder.raw_decode(buffer)
  rest = buffer[json.decoder.WHITESPACE.match(buffer, index).end():]
  return (obj, rest)
 except ValueError:
  return None

def json_splitter ( buffer ) : try : ( obj , index ) = json_decoder . raw_decode ( buffer ) rest = buffer [ json . decoder . WHITESPACE . match ( buffer , index ) . end ( ) : ] return ( obj , rest ) except ValueError : return None
attempt to parse a json object from a buffer .