class_docstr: A readonly object that wraps a protobuf Settings message.
  
  Implements the mapping protocol, so you can access settings as
  attributes or items.
class_docstr_tok: ["A","readonly","object","that","wraps","a","protobuf","Settings","message",".","Implements","the","mapping","protocol",",","so","you","can","access","settings","as","attributes","or","items","."]
code: def _from_proto(self, proto: wandb_settings_pb2.Settings) -> None:
      for field in fields(SettingsData):
          key = field.name
          value: Any = None
          if key == "_stats_open_metrics_filters":
              # todo: it's an underscored field, refactor into
              #  something more elegant?
              # I'm really about this. It's ugly, but it works.
              # Do not try to repeat this at home.
              value_type = getattr(proto, key).WhichOneof("value")
              if value_type == "sequence":
                  value = list(getattr(proto, key).sequence.value)
              elif value_type == "mapping":
                  unpacked_mapping = {}
                  for outer_key, outer_value in getattr(
                      proto, key
                  ).mapping.value.items():
                      unpacked_inner = {}
                      for (
                          inner_key,
                          inner_value,
                      ) in outer_value.value.items():
                          unpacked_inner[inner_key] = inner_value
                      unpacked_mapping[outer_key] = unpacked_inner
                  value = unpacked_mapping
          else:
              if proto.HasField(key):  # type: ignore [arg-type]
                  value = getattr(proto, key).value
                  if field.type == Sequence[str]:
                      value = list(value)
                  elif field.type == Tuple[str]:
                      value = tuple(value)
              else:
                  value = None
          object.__setattr__(self, key, value)
  
file_path: wandb/wandb/sdk/internal/settings_static.py
imports: from dataclasses import fields
  from typing import Any, Iterable, Sequence, Tuple
  from wandb.proto import wandb_settings_pb2
  from wandb.sdk.wandb_settings import SettingsData
label_desc: Use image node_id 2 for calling the SettingsStatic obj's underlying member method code with example usage: obj._from_proto(proto) without return types