code: def __setattr__(self, name: str, value):
      if isinstance(value, Meter):
          if name in self.__dict__:
              del self.__dict__[name]
          if name in self._meterdicts:
              del self._meterdicts[name]
          self.register_meter(name, value)
      elif isinstance(value, MeterDict):
          if name in self.__dict__:
              del self.__dict__[name]
          if name in self._meters:
              del self._meters[name]
          self.register_meterdict(name, value)
      else:
          super(MeterDict, self).__setattr__(name, value)
  
imports: from __future__ import annotations
  import warnings
  import json
  from typing import Dict, Union, Optional
  from collections import OrderedDict
  from .meters import Meter
label_desc: Use image node_id 4 for calling the MeterDict obj's underlying member method code with example usage: obj.__setattr__(name, value) without return types