Moved opening repos for writing function to repo.py as helper.