def stream_json_file(local_file):
for i, line in enumerate(local_file):<EOL><INDENT>try:<EOL><INDENT>data = json.loads(line.decode('<STR_LIT:utf-8>'))<EOL>yield data<EOL><DEDENT>except ValueError as e:<EOL><INDENT>logging.warning("<STR_LIT>", i, e)<EOL>continue<EOL><DEDENT><DEDENT>
Stream a JSON file (in JSON-per-line format)

    Args:
        local_file (file-like object) an open file-handle that contains a
            JSON string on each line
    Yields:
        (dict) JSON objects