class_docstr: `AlgorithmBase` is the base class of the `parl.Algorithm` in different
  frameworks.
  
  This base class mainly do the following things:
      1. Implements APIs to set or get weights of all `ModelBase` in self.__dict__;
      2. Defines common APIs that `parl.Algorithm` should implement in different frameworks.
docstr: Get weights of all `ModelBase` in self.__dict__.
  
  Note:
      `ModelBase` in list, tuple and dict will be included. But `ModelBase` in
      nested list, tuple and dict won't be included.
  
  Returns:
      Dict of weights ({attribute name: numpy array/List/Dict})
code: def get_weights(self):
      """Get weights of all `ModelBase` in self.__dict__.
  
      Note:
          `ModelBase` in list, tuple and dict will be included. But `ModelBase` in
          nested list, tuple and dict won't be included.
  
      Returns:
          Dict of weights ({attribute name: numpy array/List/Dict})
      """
      model_weights = {}
      for key in self.__dict__.keys():
          value = getattr(self, key)
          if isinstance(value, ModelBase):
              model_weights[key] = value.get_weights()
          elif isinstance(value, list) or isinstance(value, tuple):
              weights_list = []
              for x in value:
                  if isinstance(x, ModelBase):
                      weights_list.append(x.get_weights())
              if weights_list:
                  model_weights[key] = weights_list
          elif isinstance(value, dict):
              weights_dict = {}
              for sub_k, sub_v in value.items():
                  if isinstance(sub_v, ModelBase):
                      weights_dict[sub_k] = sub_v.get_weights()
              if weights_dict:
                  model_weights[key] = weights_dict
      return model_weights
  
file_path: PARL/parl/core/algorithm_base.py
imports: from parl.core.model_base import ModelBase
label_desc: Use image node_id 2 for calling the AlgorithmBase obj's underlying member method code with example usage: obj.get_weights() and returns: model_weights