code: def write_json_or_yaml(file_path, content):
      
      with codecs.open(file_path, "w", "utf-8") as f:
          f.write(get_json_or_yaml(file_path, content))
docs: Write JSON or YAML depending on the file extension.