Based on the example in Query which standard Maya dockControl is visible : you can learn the default control names for the Channel Box, Attribute Editor, etc. Based on that, how can you dock \ undock them via code?
import pymel.core as pm # To dock the Channel Box: pm.dockControl("MayaWindow|dockControl1", edit=True, floating=False) # To undock the Attribute Editor: pm.dockControl("MayaWindow|dockControl4", edit=True, floating=True)