title: Construct hierarchy tree from python flat parent-children dict list
body: <p>I have a dict list with the following structure:</p>
  
  <pre><code>[{
      "parent": "com.company.object.kind.type.subtype.family.Feline",
      "class": "com.company.object.kind.type.subtype.family.species.Cat"
  }, {
      "parent": "com.company.object.kind.type.subtype.Mammal",
      "class": "com.company.object.kind.type.subtype.family.Feline"
  }, {
      "parent": "com.company.object.Being",
      "class": "com.company.object.kind.LivingBeing"
  }, {
      "parent": "com.company.object.kind.type.subtype.family.Canine",
      "class": "com.company.object.kind.type.subtype.family.species.Wolf"
  }, {
      "parent": "com.company.object.kind.type.subtype.Mammal",
      "class": "com.company.object.kind.type.subtype.family.Canine"
  }, {
      "parent": "com.company.object.kind.type.Animal",
      "class": "com.company.object.kind.type.subtype.Mammal"
  }, {
      "parent": "com.company.object.kind.LivingBeing",
      "class": "com.company.object.kind.type.Animal"
  }, {
      "parent": "com.company.object.kind.type.Animal",
      "class": "com.company.object.kind.type.subtype.Fish"
  }, {
      "parent": "com.company.object.kind.StaticBeing",
      "class": "com.company.object.kind.type.Solid"
  }, {
      "parent": "com.company.object.Being",
      "class": "com.company.object.kind.StaticBeing"
  }, {
      "parent": "com.company.object.kind.type.subtype.family.Feline",
      "class": "com.company.object.kind.type.subtype.family.species.Lion"
  }, {
      "parent": "com.company.object.kind.type.subtype.family.Canine",
      "class": "com.company.object.kind.type.subtype.family.species.Hyena"
  }, {
      "parent": "com.company.object.kind.StaticBeing",
      "class": "com.company.object.kind.type.Liquid"
  }]
  </code></pre>
  
  <p>And need to construct a hierarchy tree from it in the following way:</p>
  
  <pre><code>[
  "com.company.object.Being" : [
          "com.company.object.kind.StaticBeing": [
              "com.company.object.kind.type.Solid",
              "com.company.object.kind.type.Liquid"
          ],
          "com.company.object.kind.LivingBeing": [
              "com.company.object.kind.type.Animal": [
                  "com.company.object.kind.type.subtype.Fish",
                  "com.company.object.kind.type.subtype.Mammal": [
                      "com.company.object.kind.type.subtype.family.Canine": [
                          "com.company.object.kind.type.subtype.family.species.Wolf",
                          "com.company.object.kind.type.subtype.family.species.Hyena"
                      ],
                      "com.company.object.kind.type.subtype.family.Feline": [
                          "com.company.object.kind.type.subtype.family.species.Lion",
                          "com.company.object.kind.type.subtype.family.species.Cat"
                      ]
                  ]
              ]
          ]
      ]
  ]
  </code></pre>
  
  <p>The packages can be different and have any type of depth, it just only needs to construct the tree from the parent-child relationships.</p>