human
I wrote the below code

    def cp(str1, str2):
        '\n                                :return:    the    longest    common    prefix    for    2    strings.\n                                '
        ls2 = len(str2)
        j = 1
        for i in range(len(str1)):
            if ((i >= ls2) or (str1[i] != str2[i])):
                j = 0
                break
        result = str1[:(i + j)]
        return result
    strs = [v[len(p):] for (p, v) in completions]
    if (len(strs) == 0):
        return ''
    if (len(strs) == 1):
        return strs[0]
    (result, tail) = (strs[0], strs[1:])
    for i in range(len(tail)):
        result = cp(result, tail[i])
        if (result == ''):
            break
    return result

What's a good function header?
assistant
#Here is Python code to fix    for    2    strings.

def commonPrefix(completions):