<s> """<STR_LIT>""" <EOL> import re <EOL> import textwrap <EOL> class Exporter ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , model , docstring = None ) : <EOL> self . model = model <EOL> """<STR_LIT>""" <EOL> self . docstring = docstring <EOL> """<STR_LIT>""" <EOL> def export ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError ( ) <EOL> formats = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> def export ( model , format , docstring = None ) : <EOL> """<STR_LIT>""" <EOL> export_module = __import__ ( '<STR_LIT>' + format , <EOL> fromlist = [ formats [ format ] ] ) <EOL> export_class = getattr ( export_module , formats [ format ] ) <EOL> e = export_class ( model , docstring ) <EOL> return e . export ( ) <EOL> def pad ( text , depth = <NUM_LIT:0> ) : <EOL> "<STR_LIT>" <EOL> text = textwrap . dedent ( text ) <EOL> text = re . sub ( r'<STR_LIT>' , '<STR_LIT:U+0020>' * depth , text ) <EOL> text += '<STR_LIT:\n>' <EOL> return text </s>
