write_json
write_json(file, data, writer=None, mode='w+', encoder=None, **opts):
LLM Docstring
Serialize data to a file as JSON, separating open options from dumper options
and supporting a custom encoder class or default function.
file:Anythe file path or stream
data:Anythe data to serialize
writer:Callable | Nonethe JSON writer (defaults to
json.dump)mode:strthe open mode
encoder:Anya JSON encoder class or default-serializer function
opts:Anymixed
openand dumper options:returns:_the writer’s result