code: def persist_to_json_file(activations, filename):
      """
      Persist the activations to the disk
      :param activations: activations (dict mapping layers)
      :param filename: output filename (JSON format)
      :return: None
      """
      with open(filename, "w") as w:
          json.dump(
              fp=w,
              obj=OrderedDict(
                  {k: v.tolist() for k, v in activations.items()}
              ),
              indent=2,
              sort_keys=False,
          )
  
imports: import json
  import os
  from collections import OrderedDict
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  from tensorflow.keras import Sequential
  from tensorflow.keras.models import Model
label_desc: Use image node_id 13 for calling a global function with example usage: persist_to_json_file(activations, filename) without return types