<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def login_token(api, username, password):
 """Login using pre routeros 6.43 authorization method."""

    sentence = api('/login')
    token = tuple(sentence)[0]['ret']
    encoded = encode_password(token, password)
    tuple(api('/login', **{'name': username, 'response': encoded}))