code: def add_and_parse_args() -> argparse.Namespace:
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
          description="Thin wrapper around floret/fasttext's `train_supervised` function.",
      )
      parser.add_argument(
          "--root_dirpath",
          type=pathlib.Path,
          required=True,
          help="path to root directory under which datasets and models are saved",
      )
      parser.add_argument(
          "--version",
          type=str,
          required=True,
          help="semantic version number to assign to trained model, e.g. '3.0'",
      )
      parser.add_argument("--dim", type=int, default=128)
      parser.add_argument("--minn", type=int, default=1)
      parser.add_argument("--maxn", type=int, default=5)
      parser.add_argument("--wordNgrams", type=int, default=2)
      parser.add_argument("--lr", type=float, default=0.35)
      parser.add_argument("--loss", type=str, default="hs")
      parser.add_argument("--epoch", type=int, default=25)
      parser.add_argument("--thread", type=int, default=None)
      parser.add_argument(
          "--cutoff", type=int, required=False, default=350_000
      )
      parser.add_argument("--save", action="store_true", default=False)
      parser.add_argument(
          "--force",
          action="store_true",
          default=False,
          help="if specified, force downloads of all datasets, "
          "even if they already exist on disk under ``root_dirpath``",
      )
      return parser.parse_args()
  
file_path: textacy/scripts/train_lang_identifier_v3.py
imports: from __future__ import annotations
  import argparse
  import logging
  import pathlib
  import floret
  import sklearn.metrics
  import textacy
  import textacy.lang_id
label_desc: Use image node_id 2 for calling a global function with example usage: add_and_parse_args() and returns: parser