code: def test_dump2stream(path=None):
      stream = [dict(a=5), dict(b=4)]
      dump2stream([dict(a=5), dict(b=4)], path)
      eq_(list(load_stream(path)), stream)
  
file_path: datalad/datalad/support/tests/test_json_py.py
imports: import logging
  import os.path
  from json import JSONDecodeError
  from datalad.support.json_py import dump, dump2stream, load, load_stream, loads
  from datalad.tests.utils_pytest import assert_in, assert_raises, eq_, swallow_logs, with_tempfile
label_desc: Use image node_id 6 for calling a global function with example usage: test_dump2stream(path) without return types