Skip to content

custom_list_names

Enum of the predefined custom list names.

CustomListName

Bases: StrEnum

Custom lists names.

Source code in mlte/custom_list/custom_list_names.py
10
11
12
13
14
class CustomListName(StrEnum):
    """Custom lists names."""

    QA_CATEGORIES = "qa_categories"
    QUALITY_ATTRIBUTES = "quality_attributes"

CustomListParentMappings

Source code in mlte/custom_list/custom_list_names.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class CustomListParentMappings:
    parent_mappings = CustomListNameDict()

    parent_mappings[CustomListName.QUALITY_ATTRIBUTES] = (
        CustomListName.QA_CATEGORIES
    )

    @staticmethod
    def get_child_list_name(
        list_name: Optional[CustomListName],
    ) -> Optional[CustomListName]:
        """Gets the name of the child list of list_name."""
        if (
            list_name
            and list_name in CustomListParentMappings.parent_mappings.values()
        ):
            child_list_name = list(
                CustomListParentMappings.parent_mappings.keys()
            )[
                list(CustomListParentMappings.parent_mappings.values()).index(
                    list_name
                )
            ]
            return child_list_name
        else:
            return None

get_child_list_name(list_name) staticmethod

Gets the name of the child list of list_name.

Source code in mlte/custom_list/custom_list_names.py
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@staticmethod
def get_child_list_name(
    list_name: Optional[CustomListName],
) -> Optional[CustomListName]:
    """Gets the name of the child list of list_name."""
    if (
        list_name
        and list_name in CustomListParentMappings.parent_mappings.values()
    ):
        child_list_name = list(
            CustomListParentMappings.parent_mappings.keys()
        )[
            list(CustomListParentMappings.parent_mappings.values()).index(
                list_name
            )
        ]
        return child_list_name
    else:
        return None