code: def write_json(filename, data):
      
      with open(filename, 'w') as file:
          json.dump(data, file, indent=4, sort_keys=True)
docs: Write data to JSON file
  
      :param filename: name of JSON file to write data to
      :type filename: str
      :param data: data to write to JSON file
      :type data: list, tuple