code: def to_dict(self):
          
          self_dict = {}
          for key, value in six.iteritems(self.__dict__):
              if self.allowed_params and key in self.allowed_params:
                  self_dict[key] = value
          return self_dict
docs: Get a dictionary representation of :class:`InstanceResource`