def METHOD_NAME(
    df: pd.DataFrame, strip_underscores: Union[str, bool] = None
) -> pd.DataFrame:
    """
    Strip underscores from DataFrames column names.
    Underscores can be stripped from the beginning, end or both.
    Examples:
        ```python
        df = _strip_underscores(df, strip_underscores='left')
        ```
    Args:
        df: The pandas DataFrame object.
        strip_underscores: Removes the outer underscores from all
            column names. Default `None` keeps outer underscores. Values can be
            either `'left'`, `'right'` or `'both'` or the respective shorthand
            `'l'`, `'r'` and `True`.
    Returns:
        A pandas DataFrame with underscores removed.
    """
    df = df.rename(
        columns=lambda x: _strip_underscores_func(x, strip_underscores)
    )
    return df