<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def call(payload, apply_changes=False):
    '''
    Sends a post command to the device and returns the decoded data.
    '''
    session, cookies, csrf_token = logon()
    response = _post_request(session, payload, cookies, csrf_token)
    if apply_changes:
        apply_payload = {"jsonrpc": "2.0",
                         "id": "ID1",
                         "method": "apply_policy_changes",
                         "params": []}
        _post_request(session, apply_payload, cookies, csrf_token)
    logout(session, cookies, csrf_token)
    return response