def _get_play(obj):
 if hasattr(obj, '_play'):
  return obj._play
 if getattr(obj, '_parent'):
  return _get_play(obj._parent)

def _get_play ( obj ) : if hasattr ( obj , '_play' ) : return obj . _play if getattr ( obj , '_parent' ) : return _get_play ( obj . _parent )
given a task or block .