<s> from wtforms import form <EOL> from wtforms . fields . core import UnboundField <EOL> from . fields import * <EOL> from . widgets import * <EOL> from . upload import * <EOL> class BaseForm ( form . Form ) : <EOL> def __init__ ( self , formdata = None , obj = None , prefix = u'<STR_LIT>' , ** kwargs ) : <EOL> self . _obj = obj <EOL> super ( BaseForm , self ) . __init__ ( formdata = formdata , obj = obj , prefix = prefix , ** kwargs ) <EOL> class FormOpts ( object ) : <EOL> __slots__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __init__ ( self , widget_args = None , form_rules = None ) : <EOL> self . widget_args = widget_args or { } <EOL> self . form_rules = form_rules <EOL> def recreate_field ( unbound ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( unbound , UnboundField ) : <EOL> raise ValueError ( '<STR_LIT>' % type ( unbound ) ) <EOL> return unbound . field_class ( * unbound . args , ** unbound . kwargs ) </s>
