data_set.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:auDeep 作者: auDeep 项目源码 文件源码
def _format_enum_values(values: List[int],
                        enum_class: Type[Enum]):
    """
    Formats a list of enum values represented by their numeric value, which may contain missing values indicated by 
    None.

    Returns a list containing a string representation for each list element, which is "None" if the element is None, or
    the name of the enum member corresponding to the numeric value in the list otherwise.

    Parameters
    ----------
    values: list
        A list of numeric enum values
    enum_class: Type[Enum]
        The enum type

    Returns
    -------
    list
        A list of strings containing a string representation for each element in the specified list
    """
    return ["None" if x == _MISSING_VALUE_INT else enum_class(x).name for x in values]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号