code: def add_and_parse_args() -> argparse.Namespace:
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter,
      )
      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. '2.0'",
      )
      parser.add_argument(
          "--min_len",
          type=int,
          default=20,
          help="minimum number of alphanumeric characters in a text "
          "for it to be included in the training dataset",
      )
      parser.add_argument(
          "--min_obs",
          type=int,
          default=300,
          help="minimum number of observations -- (text, lang) pairs -- in a language "
          "for it to be included in the training dataset",
      )
      parser.add_argument(
          "--n_iter",
          type=int,
          default=1,
          help="number of epochs to train model",
      )
      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()
  
imports: from __future__ import annotations
  import argparse
  import collections
  import logging
  import operator
  import pathlib
  import random
  import statistics
  from typing import List, Tuple
  import sklearn.metrics
  import sklearn.model_selection
  import sklearn.preprocessing
  import thinc.api
  from cytoolz import itertoolz
  import textacy
  import textacy.datasets
  import textacy.lang_id_
  import textacy.lang_id_._datasets
  import textacy.lang_id_._training
  import textacy.preprocessing
label_desc: Use image node_id 2 for calling a global function with example usage: add_and_parse_args() and returns: parser