<s> from __future__ import division <EOL> __author__ = "<STR_LIT>" <EOL> __copyright__ = "<STR_LIT>" <EOL> __credits__ = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ] <EOL> __license__ = "<STR_LIT>" <EOL> __version__ = "<STR_LIT>" <EOL> __maintainer__ = "<STR_LIT>" <EOL> __email__ = "<STR_LIT>" <EOL> __status__ = "<STR_LIT>" <EOL> def format_mapping_file ( headers , mapping_data , comments = None ) : <EOL> """<STR_LIT>""" <EOL> result = [ ] <EOL> result . append ( '<STR_LIT:#>' + '<STR_LIT:\t>' . join ( headers ) ) <EOL> if comments != None : <EOL> for comment in comments : <EOL> result . append ( '<STR_LIT:#>' + comment ) <EOL> for mapping_line in mapping_data : <EOL> if not ( len ( mapping_line ) == len ( headers ) ) : <EOL> raise RuntimeError ( '<STR_LIT>' + '<STR_LIT>' ) <EOL> result . append ( '<STR_LIT:\t>' . join ( mapping_line ) ) <EOL> str_result = '<STR_LIT:\n>' . join ( result ) <EOL> return str_result </s>
