def clone_or_fetch(self):
    if self.from_feed: return
    
    fresh_clone = True

    # ensure that REPO_ROOT already exists
    try:
      os.makedirs(settings.REPO_ROOT, 0770)
    except __HOLE__ as e:
      pass
    
    # construct the name of the directory into which to clone the repository
    dest_dir = os.path.join(settings.REPO_ROOT, self.project.url_path)

    # check if we've already cloned this project
    if os.path.isdir(dest_dir):
      fresh_clone = False

    # clone the repository, or update our copy
    try:
        clone_repo_function(self.vcs)(self.clone_url, dest_dir, fresh_clone)
    except Repository.CheckoutFailureException:
        # if we couldn't update the repository, remove anything we got and try once more
        remove_repo(dest_dir)
        fresh_clone = True
        clone_repo_function(self.vcs)(self.clone_url, dest_dir, fresh_clone)
dataset/ETHPy150Open rcos/Observatory/observatory/dashboard/models/Repository.py/Repository.clone_or_fetch