code: def get_size(self, value=None):
          
          if value is None:
              return sum(cls_val.get_size(obj_val) for obj_val, cls_val in
                         self._get_attributes())
          elif isinstance(value, type(self)):
              return value.get_size()
          else:
              msg = "{} is not an instance of {}".format(value,
                                                         type(self).__name__)
              raise PackException(msg)
docs: Calculate the total struct size in bytes.
  
          For each struct attribute, sum the result of each one's ``get_size()``
          method.
  
          Args:
              value: In structs, the user can assign other value instead of a
                  class' instance.
  
          Returns:
              int: Total number of bytes used by the struct.
  
          Raises:
              Exception: If the struct is not valid.