human
I wrote the below code

    def __build_parts(text):
        lexer = shlex.shlex(text)
        lexer.whitespace_split = True
        lexer.commenters = ''
        if ("'" in text):
            lexer.quotes = '"'
        elif ('"' in text):
            lexer.quotes = "'"
        return list(lexer)
    regex = ''
    for line in text.splitlines():
        parts = [re.escape(s) for s in __build_parts(line)]
        regex += '(?:[\\s]+)?{0}(?:[\\s]+)?'.format('(?:[\\s]+)?'.join(parts))
    return '(?m)^{0}$'.format(regex)

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def build_whitespace_split_regex(text):