code: def write_json(json_obj, filename, mode="w", print_pretty=True):
      '''write_json will (optionally,pretty print) a json object to file
      :param json_obj: the dict to print to json
      :param filename: the output file to write to
      :param pretty_print: if True, will use nicer formatting
      '''
      with open(filename, mode) as filey:
          if print_pretty:
              filey.writelines(
                  json.dumps(
                      json_obj,
                      indent=4,
                      separators=(
                          ',',
                          ': ')))
          else:
              filey.writelines(json.dumps(json_obj))
      return filenamf write_json(json_obj, filename, mode="w", print_pretty=True):
      '''write_json will (optionally,pretty print) a json object to file
      :param json_obj: the dict to print to json
      :param filename: the output file to write to
      :param pretty_print: if True, will use nicer formatting
      '''
      with open(filename, mode) as filey:
          if print_pretty:
              filey.writelines(
                  json.dumps(
                      json_obj,
                      indent=4,
                      separators=(
                          ',',
                          ': ')))
          else:
              filey.writelines(json.dumps(json_obj))
      return filename
docs: write_json will (optionally,pretty print) a json object to file
      :param json_obj: the dict to print to json
      :param filename: the output file to write to
      :param pretty_print: if True, will use nicer formatting