<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def get_jsone_context_and_template(chain, parent_link, decision_link, tasks_for):
 """Get the appropriate json-e context and template for any parent task. Args: chain (ChainOfTrust):
 the chain of trust. parent_link (LinkOfTrust):
 the parent link to test. decision_link (LinkOfTrust):
 the parent link's decision task link. tasks_for (str):
 the reason the parent link was created (cron, hg-push, action) Returns: (dict, dict):
 the json-e context and template. """

    if tasks_for == 'action':
        jsone_context, tmpl = await get_action_context_and_template(
            chain, parent_link, decision_link
        )
    else:
        tmpl = await get_in_tree_template(decision_link)
        jsone_context = await populate_jsone_context(
            chain, parent_link, decision_link, tasks_for
        )
    return jsone_context, tmpl