def METHOD_NAME(
    self,
    flag_name,
    flag_value_default=None,
    raise_error=True,
    flag_attr_name="_flags",
):
    """Get flag value from estimator class and dynamic flag overrides.
    Parameters
    ----------
    flag_name : str
        Name of flag to be retrieved
    flag_value_default : any type, optional; default=None
        Default/fallback value if flag is not found
    raise_error : bool
        whether a ValueError is raised when the flag is not found
    flag_attr_name : str, optional, default = "_flags"
        name of the flag attribute that is read
    Returns
    -------
    flag_value :
        Value of the `flag_name` flag in self. If not found, returns an error if
        raise_error is True, otherwise it returns `flag_value_default`.
    Raises
    ------
    ValueError if raise_error is True i.e. if flag_name is not in self.get_flags(
    ).keys()
    """
    collected_flags = self._get_flags(flag_attr_name=flag_attr_name)
    flag_value = collected_flags.get(flag_name, flag_value_default)
    if raise_error and flag_name not in collected_flags.keys():
        raise ValueError(f"Tag with name {flag_name} could not be found.")
    return flag_value