Try this:
dock = DockingProtocol()
dock.set_autofoldtree( True )
More generally, to get a better idea of how to use a particular function, you can use the ? operator in ipython. For example:
dock.set_autofoldtree?
Type: instancemethod
Base Class:
String Form: >
Namespace: Interactive
Docstring:
set_autofoldtree( (DockingProtocol)arg1, (bool)autofoldtree) -> None :
protocols/docking/DockingProtocol.hh:140
C++ signature :
void set_autofoldtree(protocols::docking::DockingProtocol {lvalue},bool)
This shows that the set_autofoldtree method requires a DockingProtocol instance (python takes care of this) and a boolean.