def add(self, data, conn_type, squash=True):
if data in self.children:<EOL><INDENT>return data<EOL><DEDENT>if not squash:<EOL><INDENT>self.children.append(data)<EOL>return data<EOL><DEDENT>if self.connector == conn_type:<EOL><INDENT>if (isinstance(data, QBase) and not data.negated and<EOL>(data.connector == conn_type or len(data) == <NUM_LIT:1>)):<EOL><INDENT>self.children.extend(data.children)<EOL>return self<EOL><DEDENT>else:<EOL><INDENT>self.children.append(data)<EOL>return data<EOL><DEDENT><DEDENT>else:<EOL><INDENT>obj = self._new_instance(self.children, self.connector,<EOL>self.negated)<EOL>self.connector = conn_type<EOL>self.children = [obj, data]<EOL>return data<EOL><DEDENT>
Combine this tree and the data represented by data using the
connector conn_type. The combine is done by squashing the node other
away if possible.

This tree (self) will never be pushed to a child node of the
combined tree, nor will the connector or negated properties change.

Return a node which can be used in place of data regardless if the
node other got squashed or not.

If `squash` is False the data is prepared and added as a child to
this tree without further logic.

Args:
    conn_type (str, optional ["AND", "OR"]): connection method