assert separate_character(" "" "="ndef test_decode()cipher vigenerecipher("train"decoded cipher decode("xecwqxuivcrkhwa"assert decoded ="encodedinpythonhere' the separate_character functiondef separate_character(cypherkeyword)cypher cypher upper(keyword keyword upper(cypher_num ord(cypherord(' 'keyword_num ord(keywordord(' 'return chr(ord(' '(cypher_num keyword_num and the decode methoddef decode(selfciphertext)plain [keyword self extend_keyword(len(ciphertext)for , in zip(ciphertextkeyword)plain append(separate_character( , )return "join(plainthese methods have lot of similarity to those used for encoding the great thing about having all these tests written and passing is that we can now go back and modify our codeknowing it is still safely passing the tests for exampleif we replace our existing encode and decode methods with these refactored methodsour tests still passdef _code(selftextcombine_func)text text replace("""upper(combined [keyword self extend_keyword(len(text)for , in zip(textkeyword)combined append(combine_func( , )return "join(combineddef encode(selfplaintext)return self _code(plaintextcombine_characterdef decode(selfciphertext)return self _code(ciphertextseparate_character