kmip/core/enums.py
def convert_attribute_name_to_tag(value):
    """
    A utility function that converts an attribute name string into the
    corresponding attribute tag.

    For example: 'State' -> enums.Tags.STATE

    Args:
        value (string): The string name of the attribute.

    Returns:
        enum: The Tags enumeration value that corresponds to the attribute
            name string.

    Raises:
        ValueError: if the attribute name string is not a string or if it is
            an unrecognized attribute name
    """
    if not isinstance(value, six.string_types):
        raise ValueError("The attribute name must be a string.")

    for entry in attribute_name_tag_table:
        if value == entry[0]:
            return entry[1]

    raise ValueError("Unrecognized attribute name: '{}'".format(value))
def convert_attribute_name_to_tag(value):
    """
    A utility function that converts an attribute name string into the
    corresponding attribute tag.

    For example: 'State' -> enums.Tags.STATE

    Args:
        value (string): The string name of the attribute.

    Returns:
        enum: The Tags enumeration value that corresponds to the attribute
            name string.

    Raises:
        ValueError: if the attribute name string is not a string or if it is
            an unrecognized attribute name
    """
    if not isinstance(value, six.string_types):
        raise ValueError("The attribute name must be a string.")

    for entry in attribute_name_tag_table:
        if value == entry[0]:
            return entry[1]

    raise ValueError("Unrecognized attribute name: '{}'".format(value))
A utility function that converts an attribute name string into the
    corresponding attribute tag.

    For example: 'State' -> enums.Tags.STATE

    Args:
        value (string): The string name of the attribute.

    Returns:
        enum: The Tags enumeration value that corresponds to the attribute
            name string.

    Raises:
        ValueError: if the attribute name string is not a string or if it is
            an unrecognized attribute name