code: def to_dict(self):
          '''Save this execution context into a dictionary.'''
          d = {'id': self.id,
                  'kind': self.kind}
          if self.rate != 0.0:
              d['rate'] = self.rate
          participants = []
          for p in self.participants:
              participants.append(p.to_dict())
          if participants:
              d['participants'] = participants
          props = []
          for name in self.properties:
              p = {'name': name}
              if self.properties[name]:
                  p['value'] = str(self.properties[name])
              props.append(p)
          if props:
              d[RTS_EXT_NS_YAML + 'properties'] = props
          return f to_dict(self):
          '''Save this execution context into a dictionary.'''
          d = {'id': self.id,
                  'kind': self.kind}
          if self.rate != 0.0:
              d['rate'] = self.rate
          participants = []
          for p in self.participants:
              participants.append(p.to_dict())
          if participants:
              d['participants'] = participants
          props = []
          for name in self.properties:
              p = {'name': name}
              if self.properties[name]:
                  p['value'] = str(self.properties[name])
              props.append(p)
          if props:
              d[RTS_EXT_NS_YAML + 'properties'] = props
          return d
docs: Save this execution context into a dictionary.