def METHOD_NAME(name: str, allow_underscore: bool = False) -> Tuple[bool, str]:
    if not str.isidentifier(name):
        return False, 'not a valid python identifier'
    elif name[0] == '_' or name[-1] == '_':
        if name == '_' and allow_underscore:
            return True, ''
        return False, 'axis name should should not start or end with underscore'
    else:
        if keyword.iskeyword(name):
            warnings.warn("It is discouraged to use axes names that are keywords: {}".format(name), RuntimeWarning)
        if name in ['axis']:
            warnings.warn("It is discouraged to use 'axis' as an axis name "
                          "and will raise an error in future", FutureWarning)
        return True, ''