code: def get_offset(name):
      """
      Return DateOffset object associated with rule name
  
      Examples
      --------
      get_offset('EOM') --> BMonthEnd(1)
      """
      if name not in libfreqs._dont_uppercase:
          name = name.upper()
          name = libfreqs._lite_rule_alias.get(name, name)
          name = libfreqs._lite_rule_alias.get(name.lower(), name)
      else:
          name = libfreqs._lite_rule_alias.get(name, name)
  
      if name not in _offset_map:
          try:
              split = name.split("-")
              klass = prefix_mapping[split[0]]
              # handles case where there's no suffix (and will TypeError if too
              # many '-')
              offset = klass._from_name(*split[1:])
          except (ValueError, TypeError, KeyError):
              # bad prefix or suffix
              raise ValueError(
                  libfreqs.INVALID_FREQ_ERR_MSG.format(name)
              )
          # cache
          _offset_map[name] = offset
  
      return _offset_map[name]
  
imports: from datetime import timedelta
  import re
  import numpy
  from pytz import AmbiguousTimeError
  from pandas._libs.algos import unique_deltas
  from pandas._libs.tslibs import Timedelta, Timestamp
  from pandas._libs.tslibs.ccalendar import MONTH_ALIASES, int_to_weekday
  from pandas._libs.tslibs.conversion import tz_convert
  from pandas._libs.tslibs.fields import build_field_sarray
  import pandas._libs.tslibs.frequencies
  from pandas._libs.tslibs.offsets import _offset_to_period_map
  import pandas._libs.tslibs.resolution
  from pandas._libs.tslibs.resolution import Resolution
  from pandas._libs.tslibs.timezones import UTC
  import pandas.compat
  from pandas.compat import zip
  from pandas.util._decorators import cache_readonly
  from pandas.core.dtypes.common import is_datetime64_dtype, is_period_arraylike, is_timedelta64_dtype
  from pandas.core.dtypes.generic import ABCSeries
  from pandas.core.algorithms import unique
  from pandas.tseries.offsets import DateOffset, Day, Hour, Micro, Milli, Minute, Nano, Second, prefix_mapping
label_desc: Use image node_id 3 for calling a global function with example usage: get_offset(name) and returns: _offset_map