<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> import logging <EOL> logger = logging . getLogger ( __name__ ) <EOL> from . . core import validation <EOL> from . . core . validation . warnings import EMPTY_LAYOUT , BOTH_CHILD_AND_ROOT <EOL> from . . core . properties import abstract <EOL> from . . core . properties import Int , Instance , List <EOL> from . component import Component <EOL> @ abstract <EOL> class Layout ( Component ) : <EOL> """<STR_LIT>""" <EOL> width = Int ( help = """<STR_LIT>""" ) <EOL> height = Int ( help = """<STR_LIT>""" ) <EOL> @ abstract <EOL> class BaseBox ( Layout ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> if len ( args ) > <NUM_LIT:0> and "<STR_LIT>" in kwargs : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> elif len ( args ) > <NUM_LIT:0> : <EOL> kwargs [ "<STR_LIT>" ] = list ( args ) <EOL> super ( BaseBox , self ) . __init__ ( ** kwargs ) <EOL> @ validation . warning ( EMPTY_LAYOUT ) <EOL> def _check_empty_layout ( self ) : <EOL> from itertools import chain <EOL> if not list ( chain ( self . children ) ) : <EOL> return str ( self ) <EOL> @ validation . warning ( BOTH_CHILD_AND_ROOT ) <EOL> def _check_child_is_also_root ( self ) : <EOL> problems = [ ] <EOL> for c in self . children : <EOL> if c . document is not None and c in c . document . roots : <EOL> problems . append ( str ( c ) ) <EOL> if problems : <EOL> return "<STR_LIT:U+002CU+0020>" . join ( problems ) <EOL> else : <EOL> return None <EOL> children = List ( Instance ( Component ) , help = """<STR_LIT>""" ) <EOL> class HBox ( BaseBox ) : <EOL> """<STR_LIT>""" <EOL> class VBox ( BaseBox ) : <EOL> """<STR_LIT>""" <EOL> class VBoxForm ( VBox ) : <EOL> """<STR_LIT>""" </s>
