def METHOD_NAME(text, attribute):
    return '\n'.join(['{start}{txt}{end}'.format(
            start = TEXT_CODES[attribute]['start'],
            txt = line,
            end = TEXT_CODES[attribute]['end'])
                      if line else '' for line in str(text).split('\n')])