code: def to_dict(self):
          
          dyn_dict = {}
          for (key, val) in six.iteritems(self.__dict__):
              if key not in self._printable_exclude:
                  dyn_dict[key] = val
          return dyn_dict
docs: Converts dynstruct to a dictionary.