def _complete_string(key, haystack):
if len(key) == <NUM_LIT:0>:<EOL><INDENT>return haystack<EOL><DEDENT>match = []<EOL>for straw in haystack:<EOL><INDENT>if string.find(straw, key) == <NUM_LIT:0>:<EOL><INDENT>match.append(straw)<EOL><DEDENT><DEDENT>return match<EOL>
Returns valid string completions

        Takes the string 'key' and compares it to each of the strings in
        'haystack'. The ones which beginns with 'key' are returned as result.