code: def add_child(self, child):
          
          if self.type.lower() != "directory":
              raise ValueError("Only directory objects can have children")
          if child is self:
              raise ValueError("Cannot be a child of itself!")
          if child not in self._children:
              self._children.append(child)
          child.parent = self
          return child
docs: Add a child FSEntry to this FSEntry.
  
          Only FSEntrys with a type of 'directory' can have children.
  
          This does not detect cyclic parent/child relationships, but that will
          cause problems.
  
          :param metsrw.fsentry.FSEntry child: FSEntry to add as a child
          :return: The newly added child
          :raises ValueError: If this FSEntry cannot have children.
          :raises ValueError: If the child and the parent are the same