def get_enum_of_value(enum, val):
    """
    checks, if a value is in an enum, and if true, returns value
    :param enum: enum to search in
    :param val: key or value to search for
    :return: boolean if found, enum_of_val
    """
    if val in enum._value2member_map_:
        return True, enum(val)
    elif val in enum.__members__:
        return True, val, enum[val]
    else:
        return False, None