def METHOD_NAME(self, name, content, add=True, annex=False):
    filename = opj(self.path, name)
    with open(filename, 'wb') as f:
        f.write(content.encode())
    if add:
        if annex:
            if isinstance(self.repo, AnnexRepo):
                self.repo.add(name)
            else:
                raise ValueError("Can't annex add to a non-annex repo.")
        else:
            self.repo.add(name, git=True)