def combine_comments(comments):
    '''
    Given a list of comments, strings, a single comment or a single string,
    return a single string of text containing all of the comments, prepending
    the '#' and joining with newlines as necessary.
    '''
    if not isinstance(comments, list):
        comments = [comments]
    ret = []
    for comment in comments:
        if not isinstance(comment, six.string_types):
            comment = str(comment)
        # Normalize for any spaces (or lack thereof) after the #
        ret.append('# {0}\n'.format(comment.lstrip('#').lstrip()))
    return ''.join(ret)
Given a list of comments, strings, a single comment or a single string,
    return a single string of text containing all of the comments, prepending
    the '#' and joining with newlines as necessary.