code: def test_dump(json, nl):
      buff = StringIO()
      json.dump([1], buff, nl=nl)
      buff.seek(0)
      nl = "\n" if nl else ""
      assert buff.read() == f"[1]{nl}"
  
file_path: gluonts/test/test_json.py
imports: from io import StringIO, BytesIO
  import pytest
  from gluonts.json import _orjson, _ujson, _json
label_desc: Use image node_id 4 for calling a global function with example usage: test_dump(json, nl) without return types