class_docstr: An object used for binary ops where calendrical arithmetic
  is desired rather than absolute time arithmetic. Used to
  add or subtract a whole number of periods, such as several
  months or years, to a series or index of datetime dtype.
  Works similarly to pd.DateOffset, but stores the offset
  on the device (GPU).
  
  Parameters
  ----------
  n : int, default 1
      The number of time periods the offset represents.
  **kwds
      Temporal parameter that add to or replace the offset value.
      Parameters that **add** to the offset (like Timedelta):
      - months
  
  See Also
  --------
  pandas.DateOffset : The equivalent Pandas object that this
  object replicates
  
  Examples
  --------
  >>> from cudf import DateOffset
  >>> ts = cudf.Series([
  ...     "2000-01-01 00:00:00.012345678",
  ...     "2000-01-31 00:00:00.012345678",
  ...     "2000-02-29 00:00:00.012345678",
  ... ], dtype='datetime64[ns]')
  >>> ts + DateOffset(months=3)
  0   2000-04-01 00:00:00.012345678
  1   2000-04-30 00:00:00.012345678
  2   2000-05-29 00:00:00.012345678
  dtype: datetime64[ns]
  >>> ts - DateOffset(months=12)
  0   1999-01-01 00:00:00.012345678
  1   1999-01-31 00:00:00.012345678
  2   1999-02-28 00:00:00.012345678
  dtype: datetime64[ns]
  
  Notes
  -----
  Note that cuDF does not yet support DateOffset arguments
  that 'replace' units in the datetime data being operated on
  such as
      - year
      - month
      - week
      - day
      - hour
      - minute
      - second
      - microsecond
      - millisecond
      - nanosecond
  
  cuDF does not yet support rounding via a `normalize`
  keyword argument.
docstr: Parse a string and return a DateOffset object
  expects strings of the form 3D, 25W, 10ms, 42ns, etc.
code: def _from_freqstr(cls, freqstr: str) -> Self:
      """
      Parse a string and return a DateOffset object
      expects strings of the form 3D, 25W, 10ms, 42ns, etc.
      """
      match = cls._FREQSTR_REGEX.match(freqstr)
  
      if match is None:
          raise ValueError(f"Invalid frequency string: {freqstr}")
  
      numeric_part = match.group(1)
      if numeric_part == "":
          numeric_part = "1"
      freq_part = match.group(2)
  
      if freq_part not in cls._CODES_TO_UNITS:
          raise ValueError(f"Cannot interpret frequency str: {freqstr}")
  
      return cls(**{cls._CODES_TO_UNITS[freq_part]: int(numeric_part)})
  
imports: import math
  import re
  import warnings
  from typing import Sequence, Union
  import cupy
  import numpy
  import pandas
  import pandas.tseries.offsets
  from pandas.core.tools.datetimes import _unit_map
  from typing_extensions import Self
  import cudf
  from cudf import _lib
  from cudf._lib.strings.convert.convert_integers import is_integer
  from cudf.api.types import is_integer, is_scalar
  from cudf.core import column
  from cudf.core.index import as_index
label_desc: Use image node_id 10 for calling the DateOffset obj's underlying member method code with example usage: obj._from_freqstr(cls, freqstr) and returns: cls