def to_pod(self):
orderers = {}<EOL>packages = {}<EOL>for fam, orderer in self.order_dict.iteritems():<EOL><INDENT>k = id(orderer)<EOL>orderers[k] = orderer<EOL>packages.setdefault(k, set()).add(fam)<EOL><DEDENT>orderlist = []<EOL>for k, fams in packages.iteritems():<EOL><INDENT>orderer = orderers[k]<EOL>data = to_pod(orderer)<EOL>data["<STR_LIT>"] = sorted(fams)<EOL>orderlist.append(data)<EOL><DEDENT>result = {"<STR_LIT>": orderlist}<EOL>if self.default_order is not None:<EOL><INDENT>result["<STR_LIT>"] = to_pod(self.default_order)<EOL><DEDENT>return result<EOL>
Example (in yaml):

    type: per_family
    orderers:
    - packages: ['foo', 'bah']
      type: version_split
      first_version: '4.0.5'
    - packages: ['python']
      type: sorted
      descending: false
    default_order:
      type: sorted
      descending: true