def morsel_to_cookie(morsel):
expires = None<EOL>if morsel['<STR_LIT>']:<EOL><INDENT>expires = time.time() + morsel['<STR_LIT>']<EOL><DEDENT>elif morsel['<STR_LIT>']:<EOL><INDENT>time_template = '<STR_LIT>'<EOL>expires = time.mktime(<EOL>time.strptime(morsel['<STR_LIT>'], time_template)) - time.timezone<EOL><DEDENT>return create_cookie(<EOL>comment=morsel['<STR_LIT>'],<EOL>comment_url=bool(morsel['<STR_LIT>']),<EOL>discard=False,<EOL>domain=morsel['<STR_LIT>'],<EOL>expires=expires,<EOL>name=morsel.key,<EOL>path=morsel['<STR_LIT:path>'],<EOL>port=None,<EOL>rest={'<STR_LIT>': morsel['<STR_LIT>']},<EOL>rfc2109=False,<EOL>secure=bool(morsel['<STR_LIT>']),<EOL>value=morsel.value,<EOL>version=morsel['<STR_LIT:version>'] or <NUM_LIT:0>,<EOL>)<EOL>
Convert a Morsel object into a Cookie containing the one k/v pair.