code: def _strip_underscores_func(
      col: Union[pd.Index, pd.Series],
      strip_underscores: Union[str, bool] = None,
  ) -> pd.DataFrame:
      """Strip underscores from a pandas object."""
      underscore_options = {
          None,
          "left",
          "right",
          "both",
          "l",
          "r",
          True,
      }
      if strip_underscores not in underscore_options:
          raise JanitorError(
              f"strip_underscores must be one of: {underscore_options}"
          )
  
      if strip_underscores in ["left", "l"]:
          return col.str.lstrip("_")
      if strip_underscores in ["right", "r"]:
          return col.str.rstrip("_")
      if strip_underscores in {True, "both"}:
          return col.str.strip("_")
      return col
  
file_path: pyjanitor/janitor/functions/clean_names.py
imports: import unicodedata
  from typing import Hashable, Optional, Union
  import pandas
  import pandas_flavor
  from pandas.api.types import is_scalar
  from janitor.errors import JanitorError
  from janitor.functions.utils import _is_str_or_cat, get_index_labels
  from janitor.utils import deprecated_alias
label_desc: Use image node_id 7 for calling a global function with example usage: _strip_underscores_func(col, strip_underscores) and returns: col, col, col, col