code: def write_file(path, data, format=True):
      
      if format:
          fs.write_file(path, format_json(data))
      else:
          fs.write_file(path, json.dumps(data))
docs: Write JSON data to file.
  
      Arguments:
          path (str): Destination.
          data (dict or list): JSON serializable data.
          format (bool, optional): Pretty-print JSON data.