def value(val):
    """ Convert value to python type
    :param val:
    :return:  list, string, number, bool, or none value
    """
    if val.HasField("string_value"):
        return val.string_value
    elif val.HasField("int_value"):
        return val.int_value
    elif val.HasField("bool_value"):
        return val.bool_value
    elif val.HasField("double_value"):
        return val.double_value
    elif val.HasField("struct_value"):
        return {k: value(val.struct_value.value[k]) for k in val.struct_value.value}
    else:
        return [value(v) for v in val.list_value.value]