<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_child(self, name, child):
 """ Add a new child to the node. :param name: Name of the child that must be used to access that child. Should not contain anything that could interfere with the operator `.` (dot). :param child: The new child, an instance of :any:`Scale` or :any:`Parameter` or :any:`ParameterNode`. """

        if name in self.children:
            raise ValueError("{} has already a child named {}".format(self.name, name))
        if not (isinstance(child, ParameterNode) or isinstance(child, Parameter) or isinstance(child, Scale)):
            raise TypeError("child must be of type ParameterNode, Parameter, or Scale. Instead got {}".format(type(child)))
        self.children[name] = child
        setattr(self, name, child)