def METHOD_NAME(d: NestedDictStrAny | None) -> NestedDictStrAny | None:
    # handles case for struct_pb2.Value where nested items are tuple.
    # if that is the case, then convert to list.
    # This dict is only one level deep, as we don't allow nested Multipart.
    if d is not None:
        for key, value in d.items():
            if isinstance(value, tuple):
                d[key] = list(t.cast("TupleAny", value))
            elif isinstance(value, dict):
                d[key] = METHOD_NAME(t.cast("NestedDictStrAny", value))
    return d