def METHOD_NAME(classname: str, mode: AliasMode) -> str:
    """
    Return oscal key name or field element name based on class name.
    This is applicable when asking for a singular element.
    """
    suffix = classname.split('.')[-1]
    # the alias mode is either json or field - yaml doesn't apply here
    if mode == AliasMode.JSON:
        # things like class_ should just be class
        if suffix[-1] == '_':
            suffix = suffix[:-1]
        return _camel_to_dash(suffix).rstrip(string.digits)
    # else alias mode is field
    return _camel_to_snake(suffix).rstrip(string.digits)