code: def checkout_subword_nmt(workspace_dir: str):
      
      # Prerequisites
      check_git()
      # Check cache
      dest = os.path.join(workspace_dir, DIR_THIRD_PARTY, SUBWORD_NMT_DEST)
      if confirm_checkout(dest, SUBWORD_NMT_COMMIT):
          logging.info("Usable: %s", dest)
          return
      # Need to (re-)checkout
      if os.path.exists(dest):
          shutil.rmtree(dest)
      logging.info("Checkout: %s -> %s", SUBWORD_NMT_REPO, dest)
      log_fname = os.path.join(workspace_dir, DIR_LOGS, "checkout.{}.{}.log".format(SUBWORD_NMT_DEST, os.getpid()))
      with open(log_fname, "wb") as log:
          logging.info("Log: %s", log_fname)
          subprocess.call(["git", "clone", SUBWORD_NMT_REPO, dest], stdout=log, stderr=log)
          subprocess.call(["git", "checkout", SUBWORD_NMT_COMMIT], cwd=dest, stdout=log, stderr=log)
docs: Checkout subword-nmt implementation of byte-pair encoding.
  
      :param workspace_dir: Workspace third-party directory.