def box(cls, margin, spacing, *items):
 stretch = STRETCH
 skipped = SKIPPED
 layout = cls()
 layout.setSpacing(spacing)
 set_margin(layout, margin)
 for i in items:
  if isinstance(i, QtWidgets.QWidget):
   layout.addWidget(i)
  elif isinstance(i, (QtWidgets.QHBoxLayout, QtWidgets.QVBoxLayout, QtWidgets.QFormLayout, QtWidgets.QLayout)):
   layout.addLayout(i)
  elif (i is stretch):
   layout.addStretch()
  elif (i is skipped):
   continue
  elif isinstance(i, int_types):
   layout.addSpacing(i)
 return layout

def box ( cls , margin , spacing , * items ) : stretch = STRETCH skipped = SKIPPED layout = cls ( ) layout . setSpacing ( spacing ) set_margin ( layout , margin ) for i in items : if isinstance ( i , QtWidgets . QWidget ) : layout . addWidget ( i ) elif isinstance ( i , ( QtWidgets . QHBoxLayout , QtWidgets . QVBoxLayout , QtWidgets . QFormLayout , QtWidgets . QLayout ) ) : layout . addLayout ( i ) elif ( i is stretch ) : layout . addStretch ( ) elif ( i is skipped ) : continue elif isinstance ( i , int_types ) : layout . addSpacing ( i ) return layout
turn the axes box on or off according to *on* .