code: def _git_user_defined_corpus(self, corpus_name, corpus_type, uri: str, branch='master'):
          
          # git_uri = urljoin('https://github.com/cltk/', corpus_name + '.git')
          # self._download_corpus(corpus_type, corpus_name, path)
          type_dir_rel = os.path.join(CLTK_DATA_DIR, self.language, corpus_type)
          type_dir = os.path.expanduser(type_dir_rel)
          repo_name = uri.split('/')[-1]  # eg, 'latin_corpus_newton_example.git'
          repo_name = repo_name.rstrip('.git')
          target_dir = os.path.join(type_dir, repo_name)
          target_file = os.path.join(type_dir, repo_name, 'README.md')
          # check if corpus already present
          # if not, clone
          if not os.path.isfile(target_file):
              if not os.path.isdir(type_dir):
                  os.makedirs(type_dir)
              try:
                  msg = "Cloning '{}' from '{}'".format(corpus_name, uri)
                  logger.info(msg)
                  Repo.clone_from(uri, target_dir, branch=branch, depth=1,
                                  progress=ProgressPrinter())
              except CorpusImportError as corpus_imp_err:
                  msg = "Git clone of '{}' failed: '{}'".format(uri, corpus_imp_err)
                  logger.error(msg)
          # if corpus is present, pull latest
          else:
              try:
                  repo = Repo(target_dir)
                  assert not repo.bare  # or: assert repo.exists()
                  git_origin = repo.remotes.origin
                  msg = "Pulling latest '{}' from '{}'.".format(corpus_name, uri)
                  logger.info(msg)
                  git_origin.pull()
              except CorpusImportError as corpus_imp_err:
                  msg = "Git pull of '{}' failed: '{}'".format(uri, corpus_imp_err)
                  logger.error(msg)
docs: Clone or update a git repo defined by user.
          TODO: This code is very redundant with what's in import_corpus(),
          could be refactored.