human
I wrote the below code

    def NewCandidateInsertionText(to_insert, text_after_cursor):
        overlap_len = OverlapLength(to_insert, text_after_cursor)
        if overlap_len:
            return to_insert[:(- overlap_len)]
        return to_insert
    text_after_cursor = vimsupport.TextAfterCursor()
    if (not text_after_cursor):
        return candidates
    new_candidates = []
    for candidate in candidates:
        if isinstance(candidate, dict):
            new_candidate = candidate.copy()
            if (u'abbr' not in new_candidate):
                new_candidate[u'abbr'] = new_candidate[u'word']
            new_candidate[u'word'] = NewCandidateInsertionText(new_candidate[u'word'], text_after_cursor)
            new_candidates.append(new_candidate)
        elif (isinstance(candidate, str) or isinstance(candidate, bytes)):
            new_candidates.append({u'abbr': candidate, u'word': NewCandidateInsertionText(candidate, text_after_cursor)})
    return new_candidates

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

def AdjustCandidateInsertionText(candidates):