code: def parse_time_arg(arg: Union[str, pd.Timedelta]) -> pd.Timedelta:
      """Parse the `window`/`stride` arg into a fixed set of types.
  
      Parameters
      ----------
      arg : Union[float, str, pd.Timedelta]
          The arg that will be parsed. \n
          * If the type is a `pd.Timedelta`, nothing will happen.
          * If the type is a `str`, `arg` should represent a time-string, and will be
            converted to a `pd.Timedelta`.
  
      Returns
      -------
      pd.Timedelta
          The parsed time arg
  
      Raises
      ------
      TypeError
          Raised when `arg` is not an instance of `float`, `int`, `str`, or
          `pd.Timedelta`.
  
      """
      if isinstance(arg, pd.Timedelta):
          return arg
      elif isinstance(arg, str):
          if arg.isnumeric():
              raise ValueError(
                  f"time-string arg {arg} must contain a unit"
              )
          return pd.Timedelta(arg)
      raise TypeError(f"arg type {type(arg)} is not supported!")
  
imports: from typing import Union
  import pandas
label_desc: Use image node_id 2 for calling a global function with example usage: parse_time_arg(arg) and returns: arg, pd