code: def save_to_file(json_data, filename):
      """Saves all detected configuration(s) into a JSON file.
  
      Args:
        json_data: Dict of all configurations found.
        filename: String that is the name of the output JSON file.
      """
      if filename[-5:] != ".json":
          print("filename: %s" % filename)
          filename += ".json"
  
      with open(PATH_TO_DIR + "/" + filename, "w") as f:
          json.dump(json_data, f, sort_keys=True, indent=4)
  
      print(" Successfully wrote configs to file `%s`.\n" % (filename))
  
imports: import collections
  import json
  import re
  import subprocess
  import sys
  from absl import app
  from absl import flags
  from tensorflow.tools.tensorflow_builder.config_detector.data import cuda_compute_capability
label_desc: Use image node_id 20 for calling a global function with example usage: save_to_file(json_data, filename) without return types