code: def write_contents(self, filename, contents, directory=None):
          
          filepath = "{}/{}".format(directory.rstrip("/"), filename) if directory else filename
          self._write_to_zipfile(filepath, contents)
          return filepath
docs: write_contents: Write contents to filename in zip
              Args:
                  contents: (str) contents of file
                  filename: (str) name of file in zip
                  directory: (str) directory in zipfile to write file to (optional)
              Returns: path to file in zip