code: def add_child(self, child, name=None, index=None):
          
          if name is None:
              name = child.get_name()
          if index is None:
              self._children[name] = child
          else:
              items = [item for item in self._children.items()
                       if item[0] != name]
              items.insert(int(index), (name, child))
              self._children = OrderedDict(items)
          child._parent = self
          return self
docs: Add a child.