code: def read_json_mash(
      filepath: types.PathLike,
      *,
      mode: str = "rt",
      encoding: Optional[str] = None,
      buffer_size: int = 2048,
  ) -> Iterable:
      """
      Read the contents of a JSON file at ``filepath`` one item at a time,
      where all of the items have been mashed together, end-to-end, on a single line.
  
      Args:
          filepath: Path to file on disk to which data will be written.
          mode: Mode with which ``filepath`` is opened.
          encoding: Name of the encoding used to decode or encode the data
              in ``filepath``. Only applicable in text mode.
          buffer_size: Number of bytes to read in as a chunk.
  
      Yields:
          Next valid JSON object, converted to native Python equivalent.
  
      Note:
          Storing JSON data in this format is Not Good. Reading it is doable, so
          this function is included for users' convenience, but note that
          there is no analogous ``write_json_mash()`` function. Don't do it.
      """
      io_utils._validate_read_mode(mode)
      json_decoder = json.JSONDecoder()
      with io_utils.open_sesame(
          filepath, mode=mode, encoding=encoding
      ) as f:
          buffer_ = ""
          for chunk in iter(functools.partial(f.read, buffer_size), ""):
              buffer_ += chunk
              while buffer_:
                  try:
                      result, index = json_decoder.raw_decode(buffer_)
                      yield result
                      buffer_ = buffer_[index:]
                  # not enough data to decode => read another chunk
                  except ValueError:
                      break
  
file_path: textacy/src/textacy/io/json.py
imports: from __future__ import annotations
  import datetime
  import functools
  import json
  from typing import Any, Iterable, Optional, Union
  from ..None import types
  from .None import utils
label_desc: Use image node_id 2 for calling a global function with example usage: read_json_mash(filepath) without return types