code: def write_file(path, data, mode='w'):  # type: (str, str, str) -> None
      
      with open(path, mode) as f:
          f.write(data)
docs: Write data to a file.
  
      Args:
          path (str): path to the file.
          data (str): data to be written to the file.
          mode (str): mode which the file will be open.