code: def write_spec(spec: Spec, path: str):
      """Write spec to disk as LIT JSON format."""
      with open(path, "w") as fd:
          fd.write(serialize.to_json(spec, indent=2))
  
imports: from collections.abc import Callable, Mapping, Sequence
  import hashlib
  import glob
  import inspect
  import os
  import random
  import types
  from typing import Optional, Union, cast
  from absl import logging
  from lit_nlp.api import types
  from lit_nlp.lib import serialize
  from lit_nlp.lib import utils
label_desc: Use image node_id 3 for calling a global function with example usage: write_spec(spec, path) without return types