<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def checkout(self, ref, branch=None):
 """Do a git checkout of `ref`."""

        return git_checkout(self.repo_dir, ref, branch=branch)